<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Copyright 2004-2011 H2 Group. Multiple-Licensed under the H2 License, Version 1.0,
and under the Eclipse Public License, Version 1.0
(http://h2database.com/html/license.html).
Initial Developer: H2 Group
-->
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head><meta http-equiv="Content-Type" content="text/html;charset=utf-8" /><title>
SQL Grammar
</title><link rel="stylesheet" type="text/css" href="stylesheet.css" />
<!-- [search] { -->
<script type="text/javascript" src="navigation.js"></script>
</head><body onload="highlight()" onscroll="scroll()">

<table class="nav" onmousemove="return mouseMove(event)"><tr class="nav"><td class="nav" valign="top">
<div id = "searchMenu" style="width: 180px; overflow: hidden;">
<div class="menu" style="white-space:nowrap;">
<img src="images/h2-logo-2.png"
    alt="H2 database logo"
    onclick="document.location='main.html'"
    width="136" height="74"/> &nbsp;&nbsp;<span id = "goTop" onclick="window.scrollTo(0,0)" style="color: #fff; position:fixed; font-size: 20px; cursor: pointer;">&#x25b2;</span> </div>

<form action="submit" onsubmit="return goFirst();">
<table width="100%" class="search">
    <tr class="search">
        <td class="search" colspan="2">
<!-- translate
<a href="http://translate.google.com/translate?u=http%3A%2F%2Fh2database.com"
    onclick="javascript:startTranslate();return false;">Translate</a>
<div id = "translate" style="display:none"><div id = "google_translate_element"></div></div>
translate -->
        </td>
    </tr>
    <tr class="search">
        <td class="search" colspan="2">
        <b><label for="search">Search:</label></b>
        </td>
    </tr>
    <tr class="search">
        <td class="search" colspan="2">
            <input id = "search" name="search" type="text" size="16" maxlength="100" onkeyup="listWords(this.value, '')" /><br />
            <input type="reset" id = "clear" style="display:none;" value="Clear" onclick="listWords('', '');" />
        </td>
    </tr>
    <tr class="search" style="display:none;" >
        <td class="search" style="width: 1%; vertical-align: middle;">
            <input id = "highlight" type="checkbox" checked="checked" onclick="highlightCurrent(this.checked, search.value)" />
        </td>
        <td class="search" style="width: 99%; padding: 0px; vertical-align: middle;">
            <label for="highlight">Highlight keyword(s)</label>
        </td>
    </tr>
    <tr class="search">
        <td class="search" colspan="2">
            <table id = "result" style="border: 0px;">
                <tr style="display:none"><td></td></tr>
            </table>
        </td>
    </tr>
</table>
</form>
<div class="menu">
<b><a href="main.html">Home</a></b><br />
<a href="download.html">Download</a><br />
<a href="cheatSheet.html">Cheat Sheet</a><br />
<br />
<b>Documentation</b><br />
<a href="quickstart.html">Quickstart</a><br />
<a href="installation.html">Installation</a><br />
<a href="tutorial.html">Tutorial</a><br />
<a href="features.html">Features</a><br />
<a href="performance.html">Performance</a><br />
<a href="advanced.html">Advanced</a><br />
<br />
<b>Reference</b><br />
<a href="grammar.html">SQL Grammar</a><br />
<a href="functions.html">Functions</a><br />
<a href="datatypes.html">Data Types</a><br />
<a href="../javadoc/index.html">Javadoc</a><br />
<a href="../h2.pdf">PDF (1 MB)</a><br />
<br />
<b>Support</b><br />
<a href="faq.html">FAQ</a><br />
<a href="sourceError.html">Error Analyzer</a><br />
<a href="http://groups.google.com/group/h2-database">Google Group (English)</a><br />
<a href="http://groups.google.co.jp/group/h2-database-jp">Google Group (Japanese)</a><br />
<a href="http://groups.google.com/group/h2-cn">Google Group (Chinese)</a><br />
<br />
<b>Appendix</b><br />
<a href="history.html">History &amp; Roadmap</a><br />
<a href="license.html">License</a><br />
<a href="build.html">Build</a><br />
<a href="links.html">Links</a><br />
<a href="jaqu.html">JaQu</a><br />
<a href="mvstore.html">MVStore</a><br />
<br />

</div>
</div>
</td>

<td class="nav" style="cursor: e-resize;" onmousedown="return mouseDown(event)" onmouseup="return mouseUp(event)">&nbsp;</td>
<td class="nav"><div class="content">

<!-- } -->

<h1>SQL Grammar</h1>
<h2>Index</h2>
<h3>Commands (Data Manipulation)</h3>
<!-- syntax-start
<p class="notranslate">

    <a href="#select">SELECT</a><br />

    <a href="#insert">INSERT</a><br />

    <a href="#update">UPDATE</a><br />

    <a href="#delete">DELETE</a><br />

    <a href="#backup">BACKUP</a><br />

    <a href="#call">CALL</a><br />

    <a href="#explain">EXPLAIN</a><br />

    <a href="#merge">MERGE</a><br />

    <a href="#runscript">RUNSCRIPT</a><br />

    <a href="#script">SCRIPT</a><br />

    <a href="#show">SHOW</a><br />
</p>
syntax-end -->
<!-- railroad-start -->
<table class="notranslate index">
    <tr>
        <td class="index">
            
                <a href="#select" >SELECT</a><br />
            
                <a href="#insert" >INSERT</a><br />
            
                <a href="#update" >UPDATE</a><br />
            
                <a href="#delete" >DELETE</a><br />
                    </td><td class="index">
            
                <a href="#backup" >BACKUP</a><br />
            
                <a href="#call" >CALL</a><br />
            
                <a href="#explain" >EXPLAIN</a><br />
            
                <a href="#merge" >MERGE</a><br />
                    </td><td class="index">
            
                <a href="#runscript" >RUNSCRIPT</a><br />
            
                <a href="#script" >SCRIPT</a><br />
            
                <a href="#show" >SHOW</a><br />
                    </td>
    </tr>
</table>
<!-- railroad-end -->

<h3>Commands (Data Definition)</h3>
<!-- syntax-start
<p class="notranslate">

    <a href="#alter_index_rename">ALTER INDEX RENAME</a><br />

    <a href="#alter_schema_rename">ALTER SCHEMA RENAME</a><br />

    <a href="#alter_sequence">ALTER SEQUENCE</a><br />

    <a href="#alter_table_add">ALTER TABLE ADD</a><br />

    <a href="#alter_table_add_constraint">ALTER TABLE ADD CONSTRAINT</a><br />

    <a href="#alter_table_alter">ALTER TABLE ALTER</a><br />

    <a href="#alter_table_drop_column">ALTER TABLE DROP COLUMN</a><br />

    <a href="#alter_table_drop_constraint">ALTER TABLE DROP CONSTRAINT</a><br />

    <a href="#alter_table_set">ALTER TABLE SET</a><br />

    <a href="#alter_table_rename">ALTER TABLE RENAME</a><br />

    <a href="#alter_user_admin">ALTER USER ADMIN</a><br />

    <a href="#alter_user_rename">ALTER USER RENAME</a><br />

    <a href="#alter_user_set_password">ALTER USER SET PASSWORD</a><br />

    <a href="#alter_view">ALTER VIEW</a><br />

    <a href="#analyze">ANALYZE</a><br />

    <a href="#comment">COMMENT</a><br />

    <a href="#create_aggregate">CREATE AGGREGATE</a><br />

    <a href="#create_alias">CREATE ALIAS</a><br />

    <a href="#create_constant">CREATE CONSTANT</a><br />

    <a href="#create_domain">CREATE DOMAIN</a><br />

    <a href="#create_index">CREATE INDEX</a><br />

    <a href="#create_linked_table">CREATE LINKED TABLE</a><br />

    <a href="#create_role">CREATE ROLE</a><br />

    <a href="#create_schema">CREATE SCHEMA</a><br />

    <a href="#create_sequence">CREATE SEQUENCE</a><br />

    <a href="#create_table">CREATE TABLE</a><br />

    <a href="#create_trigger">CREATE TRIGGER</a><br />

    <a href="#create_user">CREATE USER</a><br />

    <a href="#create_view">CREATE VIEW</a><br />

    <a href="#drop_aggregate">DROP AGGREGATE</a><br />

    <a href="#drop_alias">DROP ALIAS</a><br />

    <a href="#drop_all_objects">DROP ALL OBJECTS</a><br />

    <a href="#drop_constant">DROP CONSTANT</a><br />

    <a href="#drop_domain">DROP DOMAIN</a><br />

    <a href="#drop_index">DROP INDEX</a><br />

    <a href="#drop_role">DROP ROLE</a><br />

    <a href="#drop_schema">DROP SCHEMA</a><br />

    <a href="#drop_sequence">DROP SEQUENCE</a><br />

    <a href="#drop_table">DROP TABLE</a><br />

    <a href="#drop_trigger">DROP TRIGGER</a><br />

    <a href="#drop_user">DROP USER</a><br />

    <a href="#drop_view">DROP VIEW</a><br />

    <a href="#truncate_table">TRUNCATE TABLE</a><br />
</p>
syntax-end -->
<!-- railroad-start -->
<table class="notranslate index">
    <tr>
        <td class="index">
            
                <a href="#alter_index_rename" >ALTER INDEX RENAME</a><br />
            
                <a href="#alter_schema_rename" >ALTER SCHEMA RENAME</a><br />
            
                <a href="#alter_sequence" >ALTER SEQUENCE</a><br />
            
                <a href="#alter_table_add" >ALTER TABLE ADD</a><br />
            
                <a href="#alter_table_add_constraint" >ALTER TABLE ADD CONSTRAINT</a><br />
            
                <a href="#alter_table_alter" >ALTER TABLE ALTER</a><br />
            
                <a href="#alter_table_drop_column" >ALTER TABLE DROP COLUMN</a><br />
            
                <a href="#alter_table_drop_constraint" >ALTER TABLE DROP CONSTRAINT</a><br />
            
                <a href="#alter_table_set" >ALTER TABLE SET</a><br />
            
                <a href="#alter_table_rename" >ALTER TABLE RENAME</a><br />
            
                <a href="#alter_user_admin" >ALTER USER ADMIN</a><br />
            
                <a href="#alter_user_rename" >ALTER USER RENAME</a><br />
            
                <a href="#alter_user_set_password" >ALTER USER SET PASSWORD</a><br />
            
                <a href="#alter_view" >ALTER VIEW</a><br />
            
                <a href="#analyze" >ANALYZE</a><br />
                    </td><td class="index">
            
                <a href="#comment" >COMMENT</a><br />
            
                <a href="#create_aggregate" >CREATE AGGREGATE</a><br />
            
                <a href="#create_alias" >CREATE ALIAS</a><br />
            
                <a href="#create_constant" >CREATE CONSTANT</a><br />
            
                <a href="#create_domain" >CREATE DOMAIN</a><br />
            
                <a href="#create_index" >CREATE INDEX</a><br />
            
                <a href="#create_linked_table" >CREATE LINKED TABLE</a><br />
            
                <a href="#create_role" >CREATE ROLE</a><br />
            
                <a href="#create_schema" >CREATE SCHEMA</a><br />
            
                <a href="#create_sequence" >CREATE SEQUENCE</a><br />
            
                <a href="#create_table" >CREATE TABLE</a><br />
            
                <a href="#create_trigger" >CREATE TRIGGER</a><br />
            
                <a href="#create_user" >CREATE USER</a><br />
            
                <a href="#create_view" >CREATE VIEW</a><br />
            
                <a href="#drop_aggregate" >DROP AGGREGATE</a><br />
                    </td><td class="index">
            
                <a href="#drop_alias" >DROP ALIAS</a><br />
            
                <a href="#drop_all_objects" >DROP ALL OBJECTS</a><br />
            
                <a href="#drop_constant" >DROP CONSTANT</a><br />
            
                <a href="#drop_domain" >DROP DOMAIN</a><br />
            
                <a href="#drop_index" >DROP INDEX</a><br />
            
                <a href="#drop_role" >DROP ROLE</a><br />
            
                <a href="#drop_schema" >DROP SCHEMA</a><br />
            
                <a href="#drop_sequence" >DROP SEQUENCE</a><br />
            
                <a href="#drop_table" >DROP TABLE</a><br />
            
                <a href="#drop_trigger" >DROP TRIGGER</a><br />
            
                <a href="#drop_user" >DROP USER</a><br />
            
                <a href="#drop_view" >DROP VIEW</a><br />
            
                <a href="#truncate_table" >TRUNCATE TABLE</a><br />
                    </td>
    </tr>
</table>
<!-- railroad-end -->

<h3>Commands (Other)</h3>
<!-- syntax-start
<p class="notranslate">

    <a href="#checkpoint">CHECKPOINT</a><br />

    <a href="#checkpoint_sync">CHECKPOINT SYNC</a><br />

    <a href="#commit">COMMIT</a><br />

    <a href="#commit_transaction">COMMIT TRANSACTION</a><br />

    <a href="#grant_right">GRANT RIGHT</a><br />

    <a href="#grant_role">GRANT ROLE</a><br />

    <a href="#help">HELP</a><br />

    <a href="#prepare_commit">PREPARE COMMIT</a><br />

    <a href="#revoke_right">REVOKE RIGHT</a><br />

    <a href="#revoke_role">REVOKE ROLE</a><br />

    <a href="#rollback">ROLLBACK</a><br />

    <a href="#rollback_transaction">ROLLBACK TRANSACTION</a><br />

    <a href="#savepoint">SAVEPOINT</a><br />

    <a href="#set__">SET @</a><br />

    <a href="#set_allow_literals">SET ALLOW_LITERALS</a><br />

    <a href="#set_autocommit">SET AUTOCOMMIT</a><br />

    <a href="#set_cache_size">SET CACHE_SIZE</a><br />

    <a href="#set_cluster">SET CLUSTER</a><br />

    <a href="#set_collation">SET COLLATION</a><br />

    <a href="#set_compress_lob">SET COMPRESS_LOB</a><br />

    <a href="#set_database_event_listener">SET DATABASE_EVENT_LISTENER</a><br />

    <a href="#set_db_close_delay">SET DB_CLOSE_DELAY</a><br />

    <a href="#set_default_lock_timeout">SET DEFAULT_LOCK_TIMEOUT</a><br />

    <a href="#set_default_table_type">SET DEFAULT_TABLE_TYPE</a><br />

    <a href="#set_exclusive">SET EXCLUSIVE</a><br />

    <a href="#set_ignorecase">SET IGNORECASE</a><br />

    <a href="#set_log">SET LOG</a><br />

    <a href="#set_lock_mode">SET LOCK_MODE</a><br />

    <a href="#set_lock_timeout">SET LOCK_TIMEOUT</a><br />

    <a href="#set_max_length_inplace_lob">SET MAX_LENGTH_INPLACE_LOB</a><br />

    <a href="#set_max_log_size">SET MAX_LOG_SIZE</a><br />

    <a href="#set_max_memory_rows">SET MAX_MEMORY_ROWS</a><br />

    <a href="#set_max_memory_undo">SET MAX_MEMORY_UNDO</a><br />

    <a href="#set_max_operation_memory">SET MAX_OPERATION_MEMORY</a><br />

    <a href="#set_mode">SET MODE</a><br />

    <a href="#set_multi_threaded">SET MULTI_THREADED</a><br />

    <a href="#set_optimize_reuse_results">SET OPTIMIZE_REUSE_RESULTS</a><br />

    <a href="#set_password">SET PASSWORD</a><br />

    <a href="#set_query_timeout">SET QUERY_TIMEOUT</a><br />

    <a href="#set_referential_integrity">SET REFERENTIAL_INTEGRITY</a><br />

    <a href="#set_salt_hash">SET SALT HASH</a><br />

    <a href="#set_schema">SET SCHEMA</a><br />

    <a href="#set_schema_search_path">SET SCHEMA_SEARCH_PATH</a><br />

    <a href="#set_throttle">SET THROTTLE</a><br />

    <a href="#set_trace_level">SET TRACE_LEVEL</a><br />

    <a href="#set_trace_max_file_size">SET TRACE_MAX_FILE_SIZE</a><br />

    <a href="#set_undo_log">SET UNDO_LOG</a><br />

    <a href="#set_write_delay">SET WRITE_DELAY</a><br />

    <a href="#shutdown">SHUTDOWN</a><br />
</p>
syntax-end -->
<!-- railroad-start -->
<table class="notranslate index">
    <tr>
        <td class="index">
            
                <a href="#checkpoint" >CHECKPOINT</a><br />
            
                <a href="#checkpoint_sync" >CHECKPOINT SYNC</a><br />
            
                <a href="#commit" >COMMIT</a><br />
            
                <a href="#commit_transaction" >COMMIT TRANSACTION</a><br />
            
                <a href="#grant_right" >GRANT RIGHT</a><br />
            
                <a href="#grant_role" >GRANT ROLE</a><br />
            
                <a href="#help" >HELP</a><br />
            
                <a href="#prepare_commit" >PREPARE COMMIT</a><br />
            
                <a href="#revoke_right" >REVOKE RIGHT</a><br />
            
                <a href="#revoke_role" >REVOKE ROLE</a><br />
            
                <a href="#rollback" >ROLLBACK</a><br />
            
                <a href="#rollback_transaction" >ROLLBACK TRANSACTION</a><br />
            
                <a href="#savepoint" >SAVEPOINT</a><br />
            
                <a href="#set__" >SET @</a><br />
            
                <a href="#set_allow_literals" >SET ALLOW_LITERALS</a><br />
            
                <a href="#set_autocommit" >SET AUTOCOMMIT</a><br />
            
                <a href="#set_cache_size" >SET CACHE_SIZE</a><br />
                    </td><td class="index">
            
                <a href="#set_cluster" >SET CLUSTER</a><br />
            
                <a href="#set_collation" >SET COLLATION</a><br />
            
                <a href="#set_compress_lob" >SET COMPRESS_LOB</a><br />
            
                <a href="#set_database_event_listener" >SET DATABASE_EVENT_LISTENER</a><br />
            
                <a href="#set_db_close_delay" >SET DB_CLOSE_DELAY</a><br />
            
                <a href="#set_default_lock_timeout" >SET DEFAULT_LOCK_TIMEOUT</a><br />
            
                <a href="#set_default_table_type" >SET DEFAULT_TABLE_TYPE</a><br />
            
                <a href="#set_exclusive" >SET EXCLUSIVE</a><br />
            
                <a href="#set_ignorecase" >SET IGNORECASE</a><br />
            
                <a href="#set_log" >SET LOG</a><br />
            
                <a href="#set_lock_mode" >SET LOCK_MODE</a><br />
            
                <a href="#set_lock_timeout" >SET LOCK_TIMEOUT</a><br />
            
                <a href="#set_max_length_inplace_lob" >SET MAX_LENGTH_INPLACE_LOB</a><br />
            
                <a href="#set_max_log_size" >SET MAX_LOG_SIZE</a><br />
            
                <a href="#set_max_memory_rows" >SET MAX_MEMORY_ROWS</a><br />
            
                <a href="#set_max_memory_undo" >SET MAX_MEMORY_UNDO</a><br />
            
                <a href="#set_max_operation_memory" >SET MAX_OPERATION_MEMORY</a><br />
                    </td><td class="index">
            
                <a href="#set_mode" >SET MODE</a><br />
            
                <a href="#set_multi_threaded" >SET MULTI_THREADED</a><br />
            
                <a href="#set_optimize_reuse_results" >SET OPTIMIZE_REUSE_RESULTS</a><br />
            
                <a href="#set_password" >SET PASSWORD</a><br />
            
                <a href="#set_query_timeout" >SET QUERY_TIMEOUT</a><br />
            
                <a href="#set_referential_integrity" >SET REFERENTIAL_INTEGRITY</a><br />
            
                <a href="#set_salt_hash" >SET SALT HASH</a><br />
            
                <a href="#set_schema" >SET SCHEMA</a><br />
            
                <a href="#set_schema_search_path" >SET SCHEMA_SEARCH_PATH</a><br />
            
                <a href="#set_throttle" >SET THROTTLE</a><br />
            
                <a href="#set_trace_level" >SET TRACE_LEVEL</a><br />
            
                <a href="#set_trace_max_file_size" >SET TRACE_MAX_FILE_SIZE</a><br />
            
                <a href="#set_undo_log" >SET UNDO_LOG</a><br />
            
                <a href="#set_write_delay" >SET WRITE_DELAY</a><br />
            
                <a href="#shutdown" >SHUTDOWN</a><br />
                    </td>
    </tr>
</table>
<!-- railroad-end -->

<h3>Other Grammar</h3>
<!-- syntax-start
<p class="notranslate">

    <a href="#alias" >Alias</a><br />

    <a href="#and_condition" >And Condition</a><br />

    <a href="#array" >Array</a><br />

    <a href="#boolean" >Boolean</a><br />

    <a href="#bytes" >Bytes</a><br />

    <a href="#case" >Case</a><br />

    <a href="#case_when" >Case When</a><br />

    <a href="#cipher" >Cipher</a><br />

    <a href="#column_definition" >Column Definition</a><br />

    <a href="#comments" >Comments</a><br />

    <a href="#compare" >Compare</a><br />

    <a href="#condition" >Condition</a><br />

    <a href="#condition_right_hand_side" >Condition Right Hand Side</a><br />

    <a href="#constraint" >Constraint</a><br />

    <a href="#constraint_name_definition" >Constraint Name Definition</a><br />

    <a href="#csv_options" >Csv Options</a><br />

    <a href="#data_type" >Data Type</a><br />

    <a href="#date" >Date</a><br />

    <a href="#decimal" >Decimal</a><br />

    <a href="#digit" >Digit</a><br />

    <a href="#dollar_quoted_string" >Dollar Quoted String</a><br />

    <a href="#expression" >Expression</a><br />

    <a href="#factor" >Factor</a><br />

    <a href="#hex" >Hex</a><br />

    <a href="#hex_number" >Hex Number</a><br />

    <a href="#index_column" >Index Column</a><br />

    <a href="#int" >Int</a><br />

    <a href="#long" >Long</a><br />

    <a href="#name" >Name</a><br />

    <a href="#null" >Null</a><br />

    <a href="#number" >Number</a><br />

    <a href="#numeric" >Numeric</a><br />

    <a href="#operand" >Operand</a><br />

    <a href="#order" >Order</a><br />

    <a href="#quoted_name" >Quoted Name</a><br />

    <a href="#referential_constraint" >Referential Constraint</a><br />

    <a href="#referential_action" >Referential Action</a><br />

    <a href="#script_compression_encryption" >Script Compression Encryption</a><br />

    <a href="#select_expression" >Select Expression</a><br />

    <a href="#string" >String</a><br />

    <a href="#summand" >Summand</a><br />

    <a href="#table_expression" >Table Expression</a><br />

    <a href="#values_expression" >Values Expression</a><br />

    <a href="#term" >Term</a><br />

    <a href="#time" >Time</a><br />

    <a href="#timestamp" >Timestamp</a><br />

    <a href="#value" >Value</a><br />
</p>
syntax-end -->
<!-- railroad-start -->
<table class="notranslate index">
    <tr>
        <td class="index">
            
                <a href="#alias" >Alias</a><br />
            
                <a href="#and_condition" >And Condition</a><br />
            
                <a href="#array" >Array</a><br />
            
                <a href="#boolean" >Boolean</a><br />
            
                <a href="#bytes" >Bytes</a><br />
            
                <a href="#case" >Case</a><br />
            
                <a href="#case_when" >Case When</a><br />
            
                <a href="#cipher" >Cipher</a><br />
            
                <a href="#column_definition" >Column Definition</a><br />
            
                <a href="#comments" >Comments</a><br />
            
                <a href="#compare" >Compare</a><br />
            
                <a href="#condition" >Condition</a><br />
            
                <a href="#condition_right_hand_side" >Condition Right Hand Side</a><br />
            
                <a href="#constraint" >Constraint</a><br />
            
                <a href="#constraint_name_definition" >Constraint Name Definition</a><br />
            
                <a href="#csv_options" >Csv Options</a><br />
                    </td><td class="index">
            
                <a href="#data_type" >Data Type</a><br />
            
                <a href="#date" >Date</a><br />
            
                <a href="#decimal" >Decimal</a><br />
            
                <a href="#digit" >Digit</a><br />
            
                <a href="#dollar_quoted_string" >Dollar Quoted String</a><br />
            
                <a href="#expression" >Expression</a><br />
            
                <a href="#factor" >Factor</a><br />
            
                <a href="#hex" >Hex</a><br />
            
                <a href="#hex_number" >Hex Number</a><br />
            
                <a href="#index_column" >Index Column</a><br />
            
                <a href="#int" >Int</a><br />
            
                <a href="#long" >Long</a><br />
            
                <a href="#name" >Name</a><br />
            
                <a href="#null" >Null</a><br />
            
                <a href="#number" >Number</a><br />
            
                <a href="#numeric" >Numeric</a><br />
                    </td><td class="index">
            
                <a href="#operand" >Operand</a><br />
            
                <a href="#order" >Order</a><br />
            
                <a href="#quoted_name" >Quoted Name</a><br />
            
                <a href="#referential_constraint" >Referential Constraint</a><br />
            
                <a href="#referential_action" >Referential Action</a><br />
            
                <a href="#script_compression_encryption" >Script Compression Encryption</a><br />
            
                <a href="#select_expression" >Select Expression</a><br />
            
                <a href="#string" >String</a><br />
            
                <a href="#summand" >Summand</a><br />
            
                <a href="#table_expression" >Table Expression</a><br />
            
                <a href="#values_expression" >Values Expression</a><br />
            
                <a href="#term" >Term</a><br />
            
                <a href="#time" >Time</a><br />
            
                <a href="#timestamp" >Timestamp</a><br />
            
                <a href="#value" >Value</a><br />
                    </td>
    </tr>
</table>
<!-- railroad-end -->

<h3>System Tables</h3>
<p class="notranslate">
<a href="#information_schema">Information Schema</a><br />
<a href="#range_table">Range Table</a><br />
</p>

<!-- railroad-start -->
<h2>Details</h2>
<p>Click on the header to switch between railroad diagram and BNF.</p>
<!-- railroad-end -->


<h3 id="select" class="notranslate" onclick="switchBnf(this)">SELECT</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SELECT [ TOP <a href="grammar.html#term">term</a> ] [ DISTINCT | ALL ] <a href="grammar.html#select_expression">selectExpression</a> [,...]
FROM <a href="grammar.html#table_expression">tableExpression</a> [,...] [ WHERE <a href="grammar.html#expression">expression</a> ]
[ GROUP BY <a href="grammar.html#expression">expression</a> [,...] ] [ HAVING <a href="grammar.html#expression">expression</a> ]
[ { UNION [ ALL ] | MINUS | EXCEPT | INTERSECT } <a href="grammar.html#select">select</a> ] [ ORDER BY <a href="grammar.html#order">order</a> [,...] ]
[ LIMIT <a href="grammar.html#expression">expression</a> [ OFFSET <a href="grammar.html#expression">expression</a> ] [ SAMPLE_SIZE <a href="grammar.html#int">rowCountInt</a> ] ]
[ FOR UPDATE ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SELECT</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">TOP <a href="grammar.html#term">term</a></code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">DISTINCT</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">ALL</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#select_expression">selectExpression</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><code class="c">FROM <a href="grammar.html#table_expression">tableExpression</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">WHERE <a href="grammar.html#expression">expression</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">GROUP BY <a href="grammar.html#expression">expression</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">HAVING <a href="grammar.html#expression">expression</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">UNION</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">ALL</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">MINUS</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">EXCEPT</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">INTERSECT</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#select">select</a></code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">ORDER BY <a href="grammar.html#order">order</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">LIMIT <a href="grammar.html#expression">expression</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">OFFSET <a href="grammar.html#expression">expression</a></code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">SAMPLE_SIZE <a href="grammar.html#int">rowCountInt</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">FOR UPDATE</code></td></tr></table></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SELECT [ TOP <a href="grammar.html#term">term</a> ] [ DISTINCT | ALL ] <a href="grammar.html#select_expression">selectExpression</a> [,...]
FROM <a href="grammar.html#table_expression">tableExpression</a> [,...] [ WHERE <a href="grammar.html#expression">expression</a> ]
[ GROUP BY <a href="grammar.html#expression">expression</a> [,...] ] [ HAVING <a href="grammar.html#expression">expression</a> ]
[ { UNION [ ALL ] | MINUS | EXCEPT | INTERSECT } <a href="grammar.html#select">select</a> ] [ ORDER BY <a href="grammar.html#order">order</a> [,...] ]
[ LIMIT <a href="grammar.html#expression">expression</a> [ OFFSET <a href="grammar.html#expression">expression</a> ] [ SAMPLE_SIZE <a href="grammar.html#int">rowCountInt</a> ] ]
[ FOR UPDATE ]
</pre>
syntax-end -->
<p>Selects data from a table or multiple tables. <code>GROUP BY</code> groups the the result by the given expression(s). <code>HAVING</code> filter rows after grouping. <code>ORDER BY</code> sorts the result by the given column(s) or expression(s). <code>UNION</code> combines the result of this query with the results of another query.</p><p><code>LIMIT</code> limits the number of rows returned by the query (no limit if null or smaller than zero). <code>OFFSET</code> specified how many rows to skip. <code>SAMPLE_SIZE</code> limits the number of rows read for aggregate queries.</p><p>Multiple set operators (<code>UNION, INTERSECT, MINUS, EXPECT</code>) are evaluated from left to right. For compatibility with other databases and future versions of H2 please use parentheses.</p><p>If <code>FOR UPDATE</code> is specified, the tables are locked for writing. When using <code>MVCC</code>, only the selected rows are locked as in an <code>UPDATE</code> statement. In this case, aggregate, <code>GROUP BY, DISTINCT</code> queries or joins are not allowed in this case.</p>
<p>Example:</p>
<p class="notranslate">
SELECT * FROM TEST;<br />SELECT * FROM TEST ORDER BY NAME;<br />SELECT ID, COUNT(*) FROM TEST GROUP BY ID;<br />SELECT NAME, COUNT(*) FROM TEST GROUP BY NAME HAVING COUNT(*) &gt; 2;<br />SELECT &#39;ID&#39; COL, MAX(ID) AS MAX FROM TEST UNION SELECT &#39;NAME&#39;, MAX(NAME) FROM TEST;<br />SELECT * FROM TEST LIMIT 1000;<br />SELECT * FROM (SELECT ID, COUNT(*) FROM TEST<br />&nbsp;&nbsp;&nbsp;&nbsp;GROUP BY ID UNION SELECT NULL, COUNT(*) FROM TEST)<br />&nbsp;&nbsp;&nbsp;&nbsp;ORDER BY 1 NULLS LAST;</p>

<h3 id="insert" class="notranslate" onclick="switchBnf(this)">INSERT</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
INSERT INTO <a href="grammar.html#name">tableName</a>
{ [ ( <a href="grammar.html#name">columnName</a> [,...] ) ]
{ VALUES { ( { DEFAULT | <a href="grammar.html#expression">expression</a> } [,...] ) } [,...] | [ DIRECT ] [ SORTED ] <a href="grammar.html#select">select</a> } } |
{ SET { <a href="grammar.html#name">columnName</a> = { DEFAULT | <a href="grammar.html#expression">expression</a> } } [,...] }
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">INSERT INTO <a href="grammar.html#name">tableName</a></code></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">( <a href="grammar.html#name">columnName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">VALUES (</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">DEFAULT</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#expression">expression</a></code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">DIRECT</code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">SORTED</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#select">select</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET <a href="grammar.html#name">columnName</a> =</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">DEFAULT</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#expression">expression</a></code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
INSERT INTO <a href="grammar.html#name">tableName</a>
{ [ ( <a href="grammar.html#name">columnName</a> [,...] ) ]
{ VALUES { ( { DEFAULT | <a href="grammar.html#expression">expression</a> } [,...] ) } [,...] | [ DIRECT ] [ SORTED ] <a href="grammar.html#select">select</a> } } |
{ SET { <a href="grammar.html#name">columnName</a> = { DEFAULT | <a href="grammar.html#expression">expression</a> } } [,...] }
</pre>
syntax-end -->
<p>Inserts a new row / new rows into a table.</p><p>When using <code>DIRECT</code>, then the results from the query are directly applied in the target table without any intermediate step.</p><p>When using <code>SORTED</code>, b-tree pages are split at the insertion point. This can improve performance and reduce disk usage.</p>
<p>Example:</p>
<p class="notranslate">
INSERT INTO TEST VALUES(1, &#39;Hello&#39;)</p>

<h3 id="update" class="notranslate" onclick="switchBnf(this)">UPDATE</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
UPDATE <a href="grammar.html#name">tableName</a> [ [ AS ] <a href="grammar.html#alias">newTableAlias</a> ]
SET { <a href="grammar.html#name">columnName</a> = { DEFAULT | <a href="grammar.html#expression">expression</a> } } [,...]
[ WHERE <a href="grammar.html#expression">expression</a> ] [ LIMIT <a href="grammar.html#expression">expression</a> ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">UPDATE <a href="grammar.html#name">tableName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">AS</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#alias">newTableAlias</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET <a href="grammar.html#name">columnName</a> =</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">DEFAULT</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#expression">expression</a></code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">WHERE <a href="grammar.html#expression">expression</a></code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">LIMIT <a href="grammar.html#expression">expression</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
UPDATE <a href="grammar.html#name">tableName</a> [ [ AS ] <a href="grammar.html#alias">newTableAlias</a> ]
SET { <a href="grammar.html#name">columnName</a> = { DEFAULT | <a href="grammar.html#expression">expression</a> } } [,...]
[ WHERE <a href="grammar.html#expression">expression</a> ] [ LIMIT <a href="grammar.html#expression">expression</a> ]
</pre>
syntax-end -->
<p>Updates data in a table.</p>
<p>Example:</p>
<p class="notranslate">
UPDATE TEST SET NAME=&#39;Hi&#39; WHERE ID=1;<br />UPDATE PERSON P SET NAME=(SELECT A.NAME FROM ADDRESS A WHERE A.ID=P.ID);</p>

<h3 id="delete" class="notranslate" onclick="switchBnf(this)">DELETE</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
DELETE [ TOP <a href="grammar.html#term">term</a> ] FROM <a href="grammar.html#name">tableName</a> [ WHERE <a href="grammar.html#expression">expression</a> ] [ LIMIT <a href="grammar.html#term">term</a> ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">DELETE</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">TOP <a href="grammar.html#term">term</a></code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">FROM <a href="grammar.html#name">tableName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">WHERE <a href="grammar.html#expression">expression</a></code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">LIMIT <a href="grammar.html#term">term</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
DELETE [ TOP <a href="grammar.html#term">term</a> ] FROM <a href="grammar.html#name">tableName</a> [ WHERE <a href="grammar.html#expression">expression</a> ] [ LIMIT <a href="grammar.html#term">term</a> ]
</pre>
syntax-end -->
<p>Deletes rows form a table. If <code>TOP</code> or <code>LIMIT</code> is specified, at most the specified number of rows are deleted (no limit if null or smaller than zero).</p>
<p>Example:</p>
<p class="notranslate">
DELETE FROM TEST WHERE ID=2</p>

<h3 id="backup" class="notranslate" onclick="switchBnf(this)">BACKUP</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
BACKUP TO <a href="grammar.html#string">fileNameString</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">BACKUP TO <a href="grammar.html#string">fileNameString</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
BACKUP TO <a href="grammar.html#string">fileNameString</a>
</pre>
syntax-end -->
<p>Backs up the database files to a .zip file. Objects are not locked, but the backup is transactionally consistent because the transaction log is also copied. Admin rights are required to execute this command.</p>
<p>Example:</p>
<p class="notranslate">
BACKUP TO &#39;backup.zip&#39;</p>

<h3 id="call" class="notranslate" onclick="switchBnf(this)">CALL</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
CALL <a href="grammar.html#expression">expression</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">CALL <a href="grammar.html#expression">expression</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
CALL <a href="grammar.html#expression">expression</a>
</pre>
syntax-end -->
<p>Calculates a simple expression. This statement returns a result set with one row, except if the called function returns a result set itself. If the called function returns an array, then each element in this array is returned as a column.</p>
<p>Example:</p>
<p class="notranslate">
CALL 15*25</p>

<h3 id="explain" class="notranslate" onclick="switchBnf(this)">EXPLAIN</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
EXPLAIN { [ PLAN FOR ] | ANALYZE } { <a href="grammar.html#select">select</a> | <a href="grammar.html#insert">insert</a> | <a href="grammar.html#update">update</a> | <a href="grammar.html#delete">delete</a> | <a href="grammar.html#merge">merge</a> }
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">EXPLAIN</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">PLAN FOR</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">ANALYZE</code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c"><a href="grammar.html#select">select</a></code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#insert">insert</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#update">update</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#delete">delete</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#merge">merge</a></code></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
EXPLAIN { [ PLAN FOR ] | ANALYZE } { <a href="grammar.html#select">select</a> | <a href="grammar.html#insert">insert</a> | <a href="grammar.html#update">update</a> | <a href="grammar.html#delete">delete</a> | <a href="grammar.html#merge">merge</a> }
</pre>
syntax-end -->
<p>Shows the execution plan for a statement. When using <code>EXPLAIN ANALYZE</code>, the statement is actually executed, and the query plan will include the actual row scan count for each table.</p>
<p>Example:</p>
<p class="notranslate">
EXPLAIN SELECT * FROM TEST WHERE ID=1</p>

<h3 id="merge" class="notranslate" onclick="switchBnf(this)">MERGE</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
MERGE INTO <a href="grammar.html#name">tableName</a> [ ( <a href="grammar.html#name">columnName</a> [,...] ) ]
[ KEY ( <a href="grammar.html#name">columnName</a> [,...] ) ]
{ VALUES { ( { DEFAULT | <a href="grammar.html#expression">expression</a> } [,...] ) } [,...] | <a href="grammar.html#select">select</a> }
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">MERGE INTO <a href="grammar.html#name">tableName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">( <a href="grammar.html#name">columnName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">KEY ( <a href="grammar.html#name">columnName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td></tr></table></td><td class="le"></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">VALUES (</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">DEFAULT</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#expression">expression</a></code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#select">select</a></code></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
MERGE INTO <a href="grammar.html#name">tableName</a> [ ( <a href="grammar.html#name">columnName</a> [,...] ) ]
[ KEY ( <a href="grammar.html#name">columnName</a> [,...] ) ]
{ VALUES { ( { DEFAULT | <a href="grammar.html#expression">expression</a> } [,...] ) } [,...] | <a href="grammar.html#select">select</a> }
</pre>
syntax-end -->
<p>Updates existing rows, and insert rows that don&#39;t exist. If no key column is specified, the primary key columns are used to find the row. If more than one row per new row is affected, an exception is thrown. If the table contains an auto-incremented key or identity column, and the row was updated, the generated key is set to 0; otherwise it is set to the new key.</p>
<p>Example:</p>
<p class="notranslate">
MERGE INTO TEST KEY(ID) VALUES(2, &#39;World&#39;)</p>

<h3 id="runscript" class="notranslate" onclick="switchBnf(this)">RUNSCRIPT</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
RUNSCRIPT FROM <a href="grammar.html#string">fileNameString</a> <a href="grammar.html#script_compression_encryption">scriptCompressionEncryption</a>
[ CHARSET <a href="grammar.html#string">charsetString</a> ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">RUNSCRIPT FROM <a href="grammar.html#string">fileNameString</a> <a href="grammar.html#script_compression_encryption">scriptCompressionEncryption</a></code></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">CHARSET <a href="grammar.html#string">charsetString</a></code></td></tr></table></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
RUNSCRIPT FROM <a href="grammar.html#string">fileNameString</a> <a href="grammar.html#script_compression_encryption">scriptCompressionEncryption</a>
[ CHARSET <a href="grammar.html#string">charsetString</a> ]
</pre>
syntax-end -->
<p>Runs a SQL script from a file. The script is a text file containing SQL statements; each statement must end with &#39;;&#39;. This command can be used to restore a database from a backup. The password must be in single quotes; it is case sensitive and can contain spaces.</p><p>Instead of a file name, an URL may be used. To read a stream from the classpath, use the prefix &#39;classpath:&#39;.</p><p>The compression algorithm must match the one used when creating the script. Instead of a file, an URL may be used.</p><p>Admin rights are required to execute this command.</p>
<p>Example:</p>
<p class="notranslate">
RUNSCRIPT FROM &#39;backup.sql&#39;</p>

<h3 id="script" class="notranslate" onclick="switchBnf(this)">SCRIPT</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SCRIPT [ SIMPLE ] [ NODATA ] [ NOPASSWORDS ] [ NOSETTINGS ]
[ DROP ] [ BLOCKSIZE <a href="grammar.html#int">blockSizeInt</a> ]
[ TO <a href="grammar.html#string">fileNameString</a> <a href="grammar.html#script_compression_encryption">scriptCompressionEncryption</a>
[ CHARSET <a href="grammar.html#string">charsetString</a> ] ]
[ TABLE <a href="grammar.html#name">tableName</a> [, ...] ]
[ SCHEMA <a href="grammar.html#name">schemaName</a> [, ...] ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SCRIPT</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">SIMPLE</code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">NODATA</code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">NOPASSWORDS</code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">NOSETTINGS</code></td><td class="le"></td></tr></table></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">DROP</code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">BLOCKSIZE <a href="grammar.html#int">blockSizeInt</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">TO <a href="grammar.html#string">fileNameString</a> <a href="grammar.html#script_compression_encryption">scriptCompressionEncryption</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">CHARSET <a href="grammar.html#string">charsetString</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">TABLE <a href="grammar.html#name">tableName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">, ...</code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">SCHEMA <a href="grammar.html#name">schemaName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">, ...</code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SCRIPT [ SIMPLE ] [ NODATA ] [ NOPASSWORDS ] [ NOSETTINGS ]
[ DROP ] [ BLOCKSIZE <a href="grammar.html#int">blockSizeInt</a> ]
[ TO <a href="grammar.html#string">fileNameString</a> <a href="grammar.html#script_compression_encryption">scriptCompressionEncryption</a>
[ CHARSET <a href="grammar.html#string">charsetString</a> ] ]
[ TABLE <a href="grammar.html#name">tableName</a> [, ...] ]
[ SCHEMA <a href="grammar.html#name">schemaName</a> [, ...] ]
</pre>
syntax-end -->
<p>Creates a SQL script from the database.</p><p><code>SIMPLE</code> does not use multi-row insert statements. <code>NODATA</code> will not emit <code>INSERT</code> statements. If the <code>DROP</code> option is specified, drop statements are created for tables, views, and sequences. If the block size is set, <code>CLOB</code> and <code>BLOB</code> values larger than this size are split into separate blocks.</p><p>If no file name is specified, the script is returned as a result set. This command can be used to create a backup of the database. For long term storage, it is more portable than copying the database files.</p><p>If a file name is specified, then the whole script (including insert statements) is written to this file, and a result set without the insert statements is returned.</p><p>The password must be in single quotes; it is case sensitive and can contain spaces.</p><p>This command locks objects while it is running.</p><p>When using the <code>TABLE</code> or <code>SCHEMA</code> option, only the selected table(s) / schema(s) are included.</p>
<p>Example:</p>
<p class="notranslate">
SCRIPT NODATA</p>

<h3 id="show" class="notranslate" onclick="switchBnf(this)">SHOW</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SHOW { SCHEMAS | TABLES [ FROM <a href="grammar.html#name">schemaName</a> ] |
COLUMNS FROM <a href="grammar.html#name">tableName</a> [ FROM <a href="grammar.html#name">schemaName</a> ] }
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SHOW</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">SCHEMAS</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">TABLES</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">FROM <a href="grammar.html#name">schemaName</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">COLUMNS FROM <a href="grammar.html#name">tableName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">FROM <a href="grammar.html#name">schemaName</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SHOW { SCHEMAS | TABLES [ FROM <a href="grammar.html#name">schemaName</a> ] |
COLUMNS FROM <a href="grammar.html#name">tableName</a> [ FROM <a href="grammar.html#name">schemaName</a> ] }
</pre>
syntax-end -->
<p>Lists the schemas, tables, or the columns of a table.</p>
<p>Example:</p>
<p class="notranslate">
SHOW TABLES</p>

<h3 id="alter_index_rename" class="notranslate" onclick="switchBnf(this)">ALTER INDEX RENAME</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
ALTER INDEX <a href="grammar.html#name">indexName</a> RENAME TO <a href="grammar.html#name">newIndexName</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">ALTER INDEX <a href="grammar.html#name">indexName</a> RENAME TO <a href="grammar.html#name">newIndexName</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
ALTER INDEX <a href="grammar.html#name">indexName</a> RENAME TO <a href="grammar.html#name">newIndexName</a>
</pre>
syntax-end -->
<p>Renames an index. This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
ALTER INDEX IDXNAME RENAME TO IDX_TEST_NAME</p>

<h3 id="alter_schema_rename" class="notranslate" onclick="switchBnf(this)">ALTER SCHEMA RENAME</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
ALTER SCHEMA <a href="functions.html#schema">schema</a> RENAME TO <a href="grammar.html#name">newSchemaName</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">ALTER SCHEMA <a href="functions.html#schema">schema</a> RENAME TO <a href="grammar.html#name">newSchemaName</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
ALTER SCHEMA <a href="functions.html#schema">schema</a> RENAME TO <a href="grammar.html#name">newSchemaName</a>
</pre>
syntax-end -->
<p>Renames a schema. This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
ALTER SCHEMA TEST RENAME TO PRODUCTION</p>

<h3 id="alter_sequence" class="notranslate" onclick="switchBnf(this)">ALTER SEQUENCE</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
ALTER SEQUENCE <a href="grammar.html#name">sequenceName</a> [ RESTART WITH <a href="grammar.html#long">long</a> ] [ INCREMENT BY <a href="grammar.html#long">long</a> ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">ALTER SEQUENCE <a href="grammar.html#name">sequenceName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">RESTART WITH <a href="grammar.html#long">long</a></code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">INCREMENT BY <a href="grammar.html#long">long</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
ALTER SEQUENCE <a href="grammar.html#name">sequenceName</a> [ RESTART WITH <a href="grammar.html#long">long</a> ] [ INCREMENT BY <a href="grammar.html#long">long</a> ]
</pre>
syntax-end -->
<p>Changes the next value and the increment of a sequence. This command does not commit the current transaction; however the new value is used by other transactions immediately, and rolling back this command has no effect.</p>
<p>Example:</p>
<p class="notranslate">
ALTER SEQUENCE SEQ_ID RESTART WITH 1000</p>

<h3 id="alter_table_add" class="notranslate" onclick="switchBnf(this)">ALTER TABLE ADD</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
ALTER TABLE <a href="grammar.html#name">tableName</a> ADD [ COLUMN ]
{ [ IF NOT EXISTS ] <a href="grammar.html#column_definition">columnDefinition</a> [ BEFORE <a href="grammar.html#name">columnName</a> ]
| ( { <a href="grammar.html#column_definition">columnDefinition</a> } [,...] ) }
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">ALTER TABLE <a href="grammar.html#name">tableName</a> ADD</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">COLUMN</code></td><td class="le"></td></tr></table></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IF NOT EXISTS</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#column_definition">columnDefinition</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">BEFORE <a href="grammar.html#name">columnName</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">( <a href="grammar.html#column_definition">columnDefinition</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td></tr></table></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
ALTER TABLE <a href="grammar.html#name">tableName</a> ADD [ COLUMN ]
{ [ IF NOT EXISTS ] <a href="grammar.html#column_definition">columnDefinition</a> [ BEFORE <a href="grammar.html#name">columnName</a> ]
| ( { <a href="grammar.html#column_definition">columnDefinition</a> } [,...] ) }
</pre>
syntax-end -->
<p>Adds a new column to a table. This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
ALTER TABLE TEST ADD CREATEDATE TIMESTAMP</p>

<h3 id="alter_table_add_constraint" class="notranslate" onclick="switchBnf(this)">ALTER TABLE ADD CONSTRAINT</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
ALTER TABLE <a href="grammar.html#name">tableName</a> ADD <a href="grammar.html#constraint">constraint</a> [ CHECK | NOCHECK ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">ALTER TABLE <a href="grammar.html#name">tableName</a> ADD <a href="grammar.html#constraint">constraint</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">CHECK</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">NOCHECK</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
ALTER TABLE <a href="grammar.html#name">tableName</a> ADD <a href="grammar.html#constraint">constraint</a> [ CHECK | NOCHECK ]
</pre>
syntax-end -->
<p>Adds a constraint to a table. If <code>NOCHECK</code> is specified, existing rows are not checked for consistency (the default is to check consistency for existing rows). The required indexes are automatically created if they don&#39;t exist yet. It is not possible to disable checking for unique constraints. This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
ALTER TABLE TEST ADD CONSTRAINT NAME_UNIQUE UNIQUE(NAME)</p>

<h3 id="alter_table_alter" class="notranslate" onclick="switchBnf(this)">ALTER TABLE ALTER</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
ALTER TABLE <a href="grammar.html#name">tableName</a> ALTER COLUMN <a href="grammar.html#name">columnName</a>
{ { <a href="grammar.html#data_type">dataType</a> [ DEFAULT <a href="grammar.html#expression">expression</a> ] [ [ NOT ] NULL ] [ AUTO_INCREMENT | IDENTITY ] }
| { RENAME TO <a href="grammar.html#name">name</a> }
| { RESTART WITH <a href="grammar.html#long">long</a> }
| { SELECTIVITY <a href="grammar.html#int">int</a> }
| { SET DEFAULT <a href="grammar.html#expression">expression</a> }
| { SET NULL }
| { SET NOT NULL } }
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">ALTER TABLE <a href="grammar.html#name">tableName</a> ALTER COLUMN <a href="grammar.html#name">columnName</a></code></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#data_type">dataType</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">DEFAULT <a href="grammar.html#expression">expression</a></code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">NOT</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">NULL</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">AUTO_INCREMENT</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">IDENTITY</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">RENAME TO <a href="grammar.html#name">name</a></code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">RESTART WITH <a href="grammar.html#long">long</a></code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">SELECTIVITY <a href="grammar.html#int">int</a></code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET DEFAULT <a href="grammar.html#expression">expression</a></code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET NULL</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET NOT NULL</code></td></tr></table></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
ALTER TABLE <a href="grammar.html#name">tableName</a> ALTER COLUMN <a href="grammar.html#name">columnName</a>
{ { <a href="grammar.html#data_type">dataType</a> [ DEFAULT <a href="grammar.html#expression">expression</a> ] [ [ NOT ] NULL ] [ AUTO_INCREMENT | IDENTITY ] }
| { RENAME TO <a href="grammar.html#name">name</a> }
| { RESTART WITH <a href="grammar.html#long">long</a> }
| { SELECTIVITY <a href="grammar.html#int">int</a> }
| { SET DEFAULT <a href="grammar.html#expression">expression</a> }
| { SET NULL }
| { SET NOT NULL } }
</pre>
syntax-end -->
<p>Changes the data type of a column, rename a column, change the identity value, or change the selectivity.</p><p>Changing the data type fails if the data can not be converted.</p><p><code>RESTART</code> changes the next value of an auto increment column. The column must already be an auto increment column. For <code>RESTART</code>, the same transactional rules as for <code>ALTER SEQUENCE</code> apply.</p><p><code>SELECTIVITY</code> sets the selectivity (1-100) for a column. Setting the selectivity to 0 means the default value. Selectivity is used by the cost based optimizer to calculate the estimated cost of an index. Selectivity 100 means values are unique, 10 means every distinct value appears 10 times on average.</p><p><code>SET DEFAULT</code> changes the default value of a column.</p><p><code>SET NULL</code> sets a column to allow <code>NULL</code>. The row may not be part of a primary key. Single column indexes on this column are dropped.</p><p><code>SET NOT NULL</code> sets a column to not allow <code>NULL</code>. Rows may not contains <code>NULL</code> in this column.</p><p>This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
ALTER TABLE TEST ALTER COLUMN NAME CLOB;<br />ALTER TABLE TEST ALTER COLUMN NAME RENAME TO TEXT;<br />ALTER TABLE TEST ALTER COLUMN ID RESTART WITH 10000;<br />ALTER TABLE TEST ALTER COLUMN NAME SELECTIVITY 100;<br />ALTER TABLE TEST ALTER COLUMN NAME SET DEFAULT &#39;&#39;;<br />ALTER TABLE TEST ALTER COLUMN NAME SET NOT NULL;<br />ALTER TABLE TEST ALTER COLUMN NAME SET NULL;</p>

<h3 id="alter_table_drop_column" class="notranslate" onclick="switchBnf(this)">ALTER TABLE DROP COLUMN</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
ALTER TABLE <a href="grammar.html#name">tableName</a> DROP COLUMN [ IF EXISTS ] <a href="grammar.html#name">columnName</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">ALTER TABLE <a href="grammar.html#name">tableName</a> DROP COLUMN</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IF EXISTS</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#name">columnName</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
ALTER TABLE <a href="grammar.html#name">tableName</a> DROP COLUMN [ IF EXISTS ] <a href="grammar.html#name">columnName</a>
</pre>
syntax-end -->
<p>Removes a column from a table. This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
ALTER TABLE TEST DROP COLUMN NAME</p>

<h3 id="alter_table_drop_constraint" class="notranslate" onclick="switchBnf(this)">ALTER TABLE DROP CONSTRAINT</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
ALTER TABLE <a href="grammar.html#name">tableName</a> DROP { CONSTRAINT [ IF EXISTS ] <a href="grammar.html#name">constraintName</a> | PRIMARY KEY }
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">ALTER TABLE <a href="grammar.html#name">tableName</a> DROP</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">CONSTRAINT</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IF EXISTS</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#name">constraintName</a></code></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">PRIMARY KEY</code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
ALTER TABLE <a href="grammar.html#name">tableName</a> DROP { CONSTRAINT [ IF EXISTS ] <a href="grammar.html#name">constraintName</a> | PRIMARY KEY }
</pre>
syntax-end -->
<p>Removes a constraint or a primary key from a table. This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
ALTER TABLE TEST DROP CONSTRAINT UNIQUE_NAME</p>

<h3 id="alter_table_set" class="notranslate" onclick="switchBnf(this)">ALTER TABLE SET</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
ALTER TABLE <a href="grammar.html#name">tableName</a> SET REFERENTIAL_INTEGRITY
{ FALSE | TRUE [ CHECK | NOCHECK ] }
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">ALTER TABLE <a href="grammar.html#name">tableName</a> SET REFERENTIAL_INTEGRITY</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">FALSE</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">TRUE</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">CHECK</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">NOCHECK</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
ALTER TABLE <a href="grammar.html#name">tableName</a> SET REFERENTIAL_INTEGRITY
{ FALSE | TRUE [ CHECK | NOCHECK ] }
</pre>
syntax-end -->
<p>Disables or enables referential integrity checking for a table. This command can be used inside a transaction. Enabling referential integrity does not check existing data, except if <code>CHECK</code> is specified. Use <code>SET REFERENTIAL_INTEGRITY</code> to disable it for all tables; the global flag and the flag for each table are independent.</p><p>This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
ALTER TABLE TEST SET REFERENTIAL_INTEGRITY FALSE</p>

<h3 id="alter_table_rename" class="notranslate" onclick="switchBnf(this)">ALTER TABLE RENAME</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
ALTER TABLE <a href="grammar.html#name">tableName</a> RENAME TO <a href="grammar.html#name">newName</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">ALTER TABLE <a href="grammar.html#name">tableName</a> RENAME TO <a href="grammar.html#name">newName</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
ALTER TABLE <a href="grammar.html#name">tableName</a> RENAME TO <a href="grammar.html#name">newName</a>
</pre>
syntax-end -->
<p>Renames a table. This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
ALTER TABLE TEST RENAME TO MY_DATA</p>

<h3 id="alter_user_admin" class="notranslate" onclick="switchBnf(this)">ALTER USER ADMIN</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
ALTER USER <a href="grammar.html#name">userName</a> ADMIN { TRUE | FALSE }
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">ALTER USER <a href="grammar.html#name">userName</a> ADMIN</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">TRUE</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">FALSE</code></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
ALTER USER <a href="grammar.html#name">userName</a> ADMIN { TRUE | FALSE }
</pre>
syntax-end -->
<p>Switches the admin flag of a user on or off.</p><p>Only unquoted or uppercase user names are allowed. Admin rights are required to execute this command. This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
ALTER USER TOM ADMIN TRUE</p>

<h3 id="alter_user_rename" class="notranslate" onclick="switchBnf(this)">ALTER USER RENAME</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
ALTER USER <a href="grammar.html#name">userName</a> RENAME TO <a href="grammar.html#name">newUserName</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">ALTER USER <a href="grammar.html#name">userName</a> RENAME TO <a href="grammar.html#name">newUserName</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
ALTER USER <a href="grammar.html#name">userName</a> RENAME TO <a href="grammar.html#name">newUserName</a>
</pre>
syntax-end -->
<p>Renames a user. After renaming a user, the password becomes invalid and needs to be changed as well.</p><p>Only unquoted or uppercase user names are allowed. Admin rights are required to execute this command. This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
ALTER USER TOM RENAME TO THOMAS</p>

<h3 id="alter_user_set_password" class="notranslate" onclick="switchBnf(this)">ALTER USER SET PASSWORD</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
ALTER USER <a href="grammar.html#name">userName</a> SET { PASSWORD <a href="grammar.html#string">string</a> | SALT <a href="grammar.html#bytes">bytes</a> HASH <a href="grammar.html#bytes">bytes</a> }
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">ALTER USER <a href="grammar.html#name">userName</a> SET</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">PASSWORD <a href="grammar.html#string">string</a></code></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">SALT <a href="grammar.html#bytes">bytes</a> HASH <a href="grammar.html#bytes">bytes</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
ALTER USER <a href="grammar.html#name">userName</a> SET { PASSWORD <a href="grammar.html#string">string</a> | SALT <a href="grammar.html#bytes">bytes</a> HASH <a href="grammar.html#bytes">bytes</a> }
</pre>
syntax-end -->
<p>Changes the password of a user. Only unquoted or uppercase user names are allowed. The password must be enclosed in single quotes. It is case sensitive and can contain spaces. The salt and hash values are hex strings.</p><p>Admin rights are required to execute this command. This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
ALTER USER SA SET PASSWORD &#39;rioyxlgt&#39;</p>

<h3 id="alter_view" class="notranslate" onclick="switchBnf(this)">ALTER VIEW</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
ALTER VIEW <a href="grammar.html#name">viewName</a> RECOMPILE
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">ALTER VIEW <a href="grammar.html#name">viewName</a> RECOMPILE</code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
ALTER VIEW <a href="grammar.html#name">viewName</a> RECOMPILE
</pre>
syntax-end -->
<p>Recompiles a view after the underlying tables have been changed or created. This command is used for views created using <code>CREATE FORCE VIEW</code>. This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
ALTER VIEW ADDRESS_VIEW RECOMPILE</p>

<h3 id="analyze" class="notranslate" onclick="switchBnf(this)">ANALYZE</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
ANALYZE [ SAMPLE_SIZE <a href="grammar.html#int">rowCountInt</a> ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">ANALYZE</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">SAMPLE_SIZE <a href="grammar.html#int">rowCountInt</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
ANALYZE [ SAMPLE_SIZE <a href="grammar.html#int">rowCountInt</a> ]
</pre>
syntax-end -->
<p>Updates the selectivity statistics of all tables. The selectivity is used by the cost based optimizer to select the best index for a given query. If no sample size is set, up to 10000 rows per table are read. The value 0 means all rows are read. The selectivity can be set manually using <code>ALTER TABLE ALTER COLUMN SELECTIVITY</code>. Manual values are overwritten by this statement. The selectivity is available in the <code>INFORMATION_SCHEMA.COLUMNS</code> table.</p><p>This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
ANALYZE SAMPLE_SIZE 1000</p>

<h3 id="comment" class="notranslate" onclick="switchBnf(this)">COMMENT</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
COMMENT ON
{ { COLUMN [ <a href="grammar.html#name">schemaName</a>. ] <a href="grammar.html#name">tableName</a>.<a href="grammar.html#name">columnName</a> }
| { { TABLE | VIEW | CONSTANT | CONSTRAINT | ALIAS | INDEX | ROLE
| SCHEMA | SEQUENCE | TRIGGER | USER | DOMAIN } [ <a href="grammar.html#name">schemaName</a>. ] <a href="grammar.html#name">objectName</a> } }
IS <a href="grammar.html#expression">expression</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">COMMENT ON</code></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">COLUMN</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#name">schemaName</a> .</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#name">tableName</a> . <a href="grammar.html#name">columnName</a></code></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">TABLE</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">VIEW</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">CONSTANT</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">CONSTRAINT</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">ALIAS</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">INDEX</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">ROLE</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">SCHEMA</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">SEQUENCE</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">TRIGGER</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">USER</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">DOMAIN</code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#name">schemaName</a> .</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#name">objectName</a></code></td></tr></table></td><td class="le"></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IS <a href="grammar.html#expression">expression</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
COMMENT ON
{ { COLUMN [ <a href="grammar.html#name">schemaName</a>. ] <a href="grammar.html#name">tableName</a>.<a href="grammar.html#name">columnName</a> }
| { { TABLE | VIEW | CONSTANT | CONSTRAINT | ALIAS | INDEX | ROLE
| SCHEMA | SEQUENCE | TRIGGER | USER | DOMAIN } [ <a href="grammar.html#name">schemaName</a>. ] <a href="grammar.html#name">objectName</a> } }
IS <a href="grammar.html#expression">expression</a>
</pre>
syntax-end -->
<p>Sets the comment of a database object. Use <code>NULL</code> to remove the comment.</p><p>Admin rights are required to execute this command. This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
COMMENT ON TABLE TEST IS &#39;Table used for testing&#39;</p>

<h3 id="create_aggregate" class="notranslate" onclick="switchBnf(this)">CREATE AGGREGATE</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
CREATE AGGREGATE [ IF NOT EXISTS ] <a href="grammar.html#name">newAggregateName</a> FOR <a href="grammar.html#name">className</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">CREATE AGGREGATE</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IF NOT EXISTS</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#name">newAggregateName</a> FOR <a href="grammar.html#name">className</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
CREATE AGGREGATE [ IF NOT EXISTS ] <a href="grammar.html#name">newAggregateName</a> FOR <a href="grammar.html#name">className</a>
</pre>
syntax-end -->
<p>Creates a new user-defined aggregate function. The method name must be the full qualified class name. The class must implement the interface <code>org.h2.api.AggregateFunction</code>.</p><p>Admin rights are required to execute this command. This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
CREATE AGGREGATE MEDIAN FOR &quot;com.acme.db.Median&quot;</p>

<h3 id="create_alias" class="notranslate" onclick="switchBnf(this)">CREATE ALIAS</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
CREATE ALIAS [ IF NOT EXISTS ] <a href="grammar.html#name">newFunctionAliasName</a> [ DETERMINISTIC ]
{ FOR <a href="grammar.html#name">classAndMethodName</a> | AS <a href="grammar.html#string">sourceCodeString</a> }
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">CREATE ALIAS</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IF NOT EXISTS</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#name">newFunctionAliasName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">DETERMINISTIC</code></td><td class="le"></td></tr></table></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">FOR <a href="grammar.html#name">classAndMethodName</a></code></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">AS <a href="grammar.html#string">sourceCodeString</a></code></td></tr></table></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
CREATE ALIAS [ IF NOT EXISTS ] <a href="grammar.html#name">newFunctionAliasName</a> [ DETERMINISTIC ]
{ FOR <a href="grammar.html#name">classAndMethodName</a> | AS <a href="grammar.html#string">sourceCodeString</a> }
</pre>
syntax-end -->
<p>Creates a new function alias. Deterministic functions must always return the same value for the same parameters. The result of such functions is cached if possible.</p><p>The method name must be the full qualified class and method name, and may optionally include the parameter classes as in <code>java.lang.Integer.parseInt(java.lang.String, int)</code>. The class and the method must both be public, and the method must be static. The class must be available in the classpath of the database engine (when using the server mode, it must be in the classpath of the server).</p><p>When defining a function alias with source code, the Sun <code>javac</code> is compiler is used if the file <code>tools.jar</code> is in the classpath. If not, <code>javac</code> is run as a separate process. Only the source code is stored in the database; the class is compiled each time the database is re-opened. Source code is usually passed as dollar quoted text to avoid escaping problems. If import statements are used, then the tag <code>@CODE</code> must be added before the method.</p><p>If the method throws an <code>SQLException</code>, it is directly re-thrown to the calling application; all other exceptions are first converted to a <code>SQLException</code>.</p><p>If the first parameter of the Java function is a <code>java.sql.Connection</code>, then a connection to the database is provided. This connection must not be closed. If the class contains multiple methods with the given name but different parameter count, all methods are mapped.</p><p>Admin rights are required to execute this command. This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
CREATE ALIAS MY_SQRT FOR &quot;java.lang.Math.sqrt&quot;;<br />CREATE ALIAS GET_SYSTEM_PROPERTY FOR &quot;java.lang.System.getProperty&quot;;<br />CALL GET_SYSTEM_PROPERTY(&#39;java.class.path&#39;);<br />CALL GET_SYSTEM_PROPERTY(&#39;com.acme.test&#39;, &#39;true&#39;);<br />CREATE ALIAS REVERSE AS &#36;&#36; String reverse(String s) { return new StringBuilder(s).reverse().toString(); } &#36;&#36;;<br />CALL REVERSE(&#39;Test&#39;);</p>

<h3 id="create_constant" class="notranslate" onclick="switchBnf(this)">CREATE CONSTANT</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
CREATE CONSTANT [ IF NOT EXISTS ] <a href="grammar.html#name">newConstantName</a> VALUE <a href="grammar.html#expression">expression</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">CREATE CONSTANT</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IF NOT EXISTS</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#name">newConstantName</a> VALUE <a href="grammar.html#expression">expression</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
CREATE CONSTANT [ IF NOT EXISTS ] <a href="grammar.html#name">newConstantName</a> VALUE <a href="grammar.html#expression">expression</a>
</pre>
syntax-end -->
<p>Creates a new constant. This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
CREATE CONSTANT ONE VALUE 1</p>

<h3 id="create_domain" class="notranslate" onclick="switchBnf(this)">CREATE DOMAIN</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
CREATE DOMAIN [ IF NOT EXISTS ] <a href="grammar.html#name">newDomainName</a> AS <a href="grammar.html#data_type">dataType</a>
[ DEFAULT <a href="grammar.html#expression">expression</a> ] [ [ NOT ] NULL ] [ SELECTIVITY <a href="functions.html#selectivity">selectivity</a> ]
[ CHECK <a href="grammar.html#condition">condition</a> ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">CREATE DOMAIN</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IF NOT EXISTS</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#name">newDomainName</a> AS <a href="grammar.html#data_type">dataType</a></code></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">DEFAULT <a href="grammar.html#expression">expression</a></code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">NOT</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">NULL</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">SELECTIVITY <a href="functions.html#selectivity">selectivity</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">CHECK <a href="grammar.html#condition">condition</a></code></td></tr></table></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
CREATE DOMAIN [ IF NOT EXISTS ] <a href="grammar.html#name">newDomainName</a> AS <a href="grammar.html#data_type">dataType</a>
[ DEFAULT <a href="grammar.html#expression">expression</a> ] [ [ NOT ] NULL ] [ SELECTIVITY <a href="functions.html#selectivity">selectivity</a> ]
[ CHECK <a href="grammar.html#condition">condition</a> ]
</pre>
syntax-end -->
<p>Creates a new data type (domain). The check condition must evaluate to true or to <code>NULL</code> (to prevent <code>NULL</code>, use <code>NOT NULL</code>). In the condition, the term <code>VALUE</code> refers to the value being tested.</p><p>Domains are usable within the whole database. They can not be created in a specific schema.</p><p>This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
CREATE DOMAIN EMAIL AS VARCHAR(255) CHECK (POSITION(&#39;@&#39;, VALUE) &gt; 1)</p>

<h3 id="create_index" class="notranslate" onclick="switchBnf(this)">CREATE INDEX</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
CREATE
{ [ UNIQUE ] [ HASH ] INDEX [ [ IF NOT EXISTS ] <a href="grammar.html#name">newIndexName</a> ]
| PRIMARY KEY [ HASH ] }
ON <a href="grammar.html#name">tableName</a> ( <a href="grammar.html#index_column">indexColumn</a> [,...] )
</pre>
<div name="railroad">
<code class="c">CREATE</code><br /><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">UNIQUE</code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">HASH</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">INDEX</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IF NOT EXISTS</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#name">newIndexName</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">PRIMARY KEY</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">HASH</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><code class="c">ON <a href="grammar.html#name">tableName</a> ( <a href="grammar.html#index_column">indexColumn</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
CREATE
{ [ UNIQUE ] [ HASH ] INDEX [ [ IF NOT EXISTS ] <a href="grammar.html#name">newIndexName</a> ]
| PRIMARY KEY [ HASH ] }
ON <a href="grammar.html#name">tableName</a> ( <a href="grammar.html#index_column">indexColumn</a> [,...] )
</pre>
syntax-end -->
<p>Creates a new index. This command commits an open transaction.</p><p>Hash indexes are meant for in-memory databases and memory tables (<code>CREATE MEMORY TABLE</code>). For other tables, or if the index contains multiple columns, the <code>HASH</code> keyword is ignored. Hash indexes can only test for equality, and do not support range queries (similar to a hash table). Non-unique keys are supported.</p>
<p>Example:</p>
<p class="notranslate">
CREATE INDEX IDXNAME ON TEST(NAME)</p>

<h3 id="create_linked_table" class="notranslate" onclick="switchBnf(this)">CREATE LINKED TABLE</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
CREATE [ [ GLOBAL | LOCAL ] TEMPORARY ] LINKED TABLE [ IF NOT EXISTS ]
<a href="grammar.html#name">name</a> ( <a href="grammar.html#string">driverString</a>, <a href="grammar.html#string">urlString</a>, <a href="grammar.html#string">userString</a>, <a href="grammar.html#string">passwordString</a>,
[ <a href="grammar.html#string">originalSchemaString</a>, ] <a href="grammar.html#string">originalTableString</a> ) [ EMIT UPDATES | READONLY ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">CREATE</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">GLOBAL</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">LOCAL</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">TEMPORARY</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">LINKED TABLE</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IF NOT EXISTS</code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#name">name</a> ( <a href="grammar.html#string">driverString</a> , <a href="grammar.html#string">urlString</a> , <a href="grammar.html#string">userString</a> , <a href="grammar.html#string">passwordString</a> ,</code></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#string">originalSchemaString</a> ,</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#string">originalTableString</a> )</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">EMIT UPDATES</code></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">READONLY</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
CREATE [ [ GLOBAL | LOCAL ] TEMPORARY ] LINKED TABLE [ IF NOT EXISTS ]
<a href="grammar.html#name">name</a> ( <a href="grammar.html#string">driverString</a>, <a href="grammar.html#string">urlString</a>, <a href="grammar.html#string">userString</a>, <a href="grammar.html#string">passwordString</a>,
[ <a href="grammar.html#string">originalSchemaString</a>, ] <a href="grammar.html#string">originalTableString</a> ) [ EMIT UPDATES | READONLY ]
</pre>
syntax-end -->
<p>Creates a table link to an external table. The driver name may be empty if the driver is already loaded. If the schema name is not set, only one table with that name may exist in the target database.</p><p>Usually, for update statements, the old rows are deleted first and then the new rows are inserted. It is possible to emit update statements (except on rollback), however in this case multi-row unique key updates may not always work. Linked tables to the same database share one connection.</p><p>If the connection to the source database is lost, the connection is re-opened (this is a workaround for MySQL that disconnects after 8 hours of inactivity by default).</p><p>If a query is used instead of the original table name, the table is read only. Queries must be enclosed in parenthesis: <code>(SELECT * FROM ORDERS)</code>.</p><p>To use <code>JNDI</code> to get the connection, the driver class must be a javax.naming.Context (for example <code>javax.naming.InitialContext</code>), and the URL must be the resource name (for example <code>java:comp/env/jdbc/Test</code>).</p><p>Admin rights are required to execute this command. This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
CREATE LINKED TABLE LINK(&#39;org.h2.Driver&#39;, &#39;jdbc:h2:test2&#39;, &#39;sa&#39;, &#39;sa&#39;, &#39;TEST&#39;);<br />CREATE LINKED TABLE LINK(&#39;&#39;, &#39;jdbc:h2:test2&#39;, &#39;sa&#39;, &#39;sa&#39;,<br />&nbsp;&nbsp;&nbsp;&nbsp;&#39;(SELECT * FROM TEST WHERE ID&gt;0)&#39;);<br />CREATE LINKED TABLE LINK(&#39;javax.naming.InitialContext&#39;,<br />&nbsp;&nbsp;&nbsp;&nbsp;&#39;java:comp/env/jdbc/Test&#39;, NULL, NULL, &#39;(SELECT * FROM TEST WHERE ID&gt;0)&#39;);</p>

<h3 id="create_role" class="notranslate" onclick="switchBnf(this)">CREATE ROLE</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
CREATE ROLE [ IF NOT EXISTS ] <a href="grammar.html#name">newRoleName</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">CREATE ROLE</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IF NOT EXISTS</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#name">newRoleName</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
CREATE ROLE [ IF NOT EXISTS ] <a href="grammar.html#name">newRoleName</a>
</pre>
syntax-end -->
<p>Creates a new role. This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
CREATE ROLE READONLY</p>

<h3 id="create_schema" class="notranslate" onclick="switchBnf(this)">CREATE SCHEMA</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
CREATE SCHEMA [ IF NOT EXISTS ] <a href="grammar.html#name">name</a> [ AUTHORIZATION <a href="grammar.html#name">ownerUserName</a> ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">CREATE SCHEMA</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IF NOT EXISTS</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#name">name</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">AUTHORIZATION <a href="grammar.html#name">ownerUserName</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
CREATE SCHEMA [ IF NOT EXISTS ] <a href="grammar.html#name">name</a> [ AUTHORIZATION <a href="grammar.html#name">ownerUserName</a> ]
</pre>
syntax-end -->
<p>Creates a new schema. If no owner is specified, the current user is used. The user that executes the command must have admin rights, as well as the owner. Specifying the owner currently has no effect.</p><p>This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
CREATE SCHEMA TEST_SCHEMA AUTHORIZATION SA</p>

<h3 id="create_sequence" class="notranslate" onclick="switchBnf(this)">CREATE SEQUENCE</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
CREATE SEQUENCE [ IF NOT EXISTS ] <a href="grammar.html#name">newSequenceName</a> [ START WITH <a href="grammar.html#long">long</a> ]
[ INCREMENT BY <a href="grammar.html#long">long</a> ] [ CACHE <a href="grammar.html#long">long</a> ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">CREATE SEQUENCE</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IF NOT EXISTS</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#name">newSequenceName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">START WITH <a href="grammar.html#long">long</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">INCREMENT BY <a href="grammar.html#long">long</a></code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">CACHE <a href="grammar.html#long">long</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
CREATE SEQUENCE [ IF NOT EXISTS ] <a href="grammar.html#name">newSequenceName</a> [ START WITH <a href="grammar.html#long">long</a> ]
[ INCREMENT BY <a href="grammar.html#long">long</a> ] [ CACHE <a href="grammar.html#long">long</a> ]
</pre>
syntax-end -->
<p>Creates a new sequence. The data type of a sequence is <code>BIGINT</code>. Used values are never re-used, even when the transaction is rolled back.</p><p>The cache is the number of pre-allocated numbers. If the system crashes without closing the database, at most this many numbers are lost. The default cache size is 32. To disable caching, use the cache size 1 or lower.</p><p>This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
CREATE SEQUENCE SEQ_ID</p>

<h3 id="create_table" class="notranslate" onclick="switchBnf(this)">CREATE TABLE</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
CREATE [ CACHED | MEMORY ] [ TEMP | [ GLOBAL | LOCAL ] TEMPORARY ]
TABLE [ IF NOT EXISTS ] <a href="grammar.html#name">name</a>
[ ( { <a href="grammar.html#column_definition">columnDefinition</a> | <a href="grammar.html#constraint">constraint</a> } [,...] ) ]
[ ENGINE <a href="grammar.html#name">tableEngineName</a> ] [ NOT PERSISTENT ] [ TRANSACTIONAL ]
[ AS <a href="grammar.html#select">select</a> ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">CREATE</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">CACHED</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">MEMORY</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">TEMP</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">GLOBAL</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">LOCAL</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">TEMPORARY</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><code class="c">TABLE</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IF NOT EXISTS</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#name">name</a></code></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">(</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c"><a href="grammar.html#column_definition">columnDefinition</a></code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#constraint">constraint</a></code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td></tr></table></td><td class="le"></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">ENGINE <a href="grammar.html#name">tableEngineName</a></code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">NOT PERSISTENT</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">TRANSACTIONAL</code></td><td class="le"></td></tr></table></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">AS <a href="grammar.html#select">select</a></code></td></tr></table></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
CREATE [ CACHED | MEMORY ] [ TEMP | [ GLOBAL | LOCAL ] TEMPORARY ]
TABLE [ IF NOT EXISTS ] <a href="grammar.html#name">name</a>
[ ( { <a href="grammar.html#column_definition">columnDefinition</a> | <a href="grammar.html#constraint">constraint</a> } [,...] ) ]
[ ENGINE <a href="grammar.html#name">tableEngineName</a> ] [ NOT PERSISTENT ] [ TRANSACTIONAL ]
[ AS <a href="grammar.html#select">select</a> ]
</pre>
syntax-end -->
<p>Creates a new table.</p><p>Cached tables (the default for regular tables) are persistent, and the number of rows is not limited by the main memory. Memory tables (the default for temporary tables) are persistent, but the index data is kept in main memory, that means memory tables should not get too large.</p><p>Temporary tables are deleted when closing or opening a database. Temporary tables can be global (accessible by all connections) or local (only accessible by the current connection). The default for temporary tables is global. Indexes of temporary tables are kept fully in main memory, unless the temporary table is created using <code>CREATE CACHED TABLE</code>.</p><p>The <code>ENGINE</code> option is only required when custom table implementations are used. The table engine class must implement the interface <code>org.h2.api.TableEngine</code>.</p><p>Tables with the <code>NOT PERSISTENT</code> modifier are kept fully in memory, and all rows are lost when the database is closed.</p><p>The column definition is optional if a query is specified. In that case the column list of the query is used.</p><p>This command commits an open transaction, except when using <code>TRANSACTIONAL</code> (only supported for temporary tables).</p>
<p>Example:</p>
<p class="notranslate">
CREATE TABLE TEST(ID INT PRIMARY KEY, NAME VARCHAR(255))</p>

<h3 id="create_trigger" class="notranslate" onclick="switchBnf(this)">CREATE TRIGGER</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
CREATE TRIGGER [ IF NOT EXISTS ] <a href="grammar.html#name">newTriggerName</a> { BEFORE | AFTER | INSTEAD OF }
{ INSERT | UPDATE | DELETE | SELECT | ROLLBACK } [,...] ON <a href="grammar.html#name">tableName</a> [ FOR EACH ROW ]
[ QUEUE <a href="grammar.html#int">int</a> ] [ NOWAIT ] CALL <a href="grammar.html#name">triggeredClassName</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">CREATE TRIGGER</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IF NOT EXISTS</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#name">newTriggerName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">BEFORE</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">AFTER</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">INSTEAD OF</code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">INSERT</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">UPDATE</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">DELETE</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">SELECT</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">ROLLBACK</code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">ON <a href="grammar.html#name">tableName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">FOR EACH ROW</code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">QUEUE <a href="grammar.html#int">int</a></code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">NOWAIT</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">CALL <a href="grammar.html#name">triggeredClassName</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
CREATE TRIGGER [ IF NOT EXISTS ] <a href="grammar.html#name">newTriggerName</a> { BEFORE | AFTER | INSTEAD OF }
{ INSERT | UPDATE | DELETE | SELECT | ROLLBACK } [,...] ON <a href="grammar.html#name">tableName</a> [ FOR EACH ROW ]
[ QUEUE <a href="grammar.html#int">int</a> ] [ NOWAIT ] CALL <a href="grammar.html#name">triggeredClassName</a>
</pre>
syntax-end -->
<p>Creates a new trigger. The trigger class must be public and implement <code>org.h2.api.Trigger</code>. Inner classes are not supported. The class must be available in the classpath of the database engine (when using the server mode, it must be in the classpath of the server).</p><p><code>BEFORE</code> triggers are called after data conversion is made, default values are set, null and length constraint checks have been made; but before other constraints have been checked. If there are multiple triggers, the order in which they are called is undefined.</p><p><code>ROLLBACK</code> can be specified in combination with <code>INSERT, UPDATE</code>, and <code>DELETE</code>. Only row based <code>AFTER</code> trigger can be called on <code>ROLLBACK</code>. Exceptions that occur within such triggers are ignored. As the operations that occur within a trigger are part of the transaction, <code>ROLLBACK</code> triggers are only required if an operation communicates outside of the database.</p><p><code>INSTEAD OF</code> triggers are implicitly row based and behave like <code>BEFORE</code> triggers. Only the first such trigger is called. Such triggers on views are supported. They can be used to make views updatable.</p><p>A <code>BEFORE SELECT</code> trigger is fired just before the database engine tries to read from the table. The trigger can be used to update a table on demand. The trigger is called with both &#39;old&#39; and &#39;new&#39; set to null.</p><p>The <code>MERGE</code> statement will call both <code>INSERT</code> and <code>UPDATE</code> triggers. Not supported are <code>SELECT</code> triggers with the option <code>FOR EACH ROW</code>, and <code>AFTER SELECT</code> triggers.</p><p>Committing or rolling back a transaction within a trigger is not allowed, except for <code>SELECT</code> triggers.</p><p>By default a trigger is called once for each statement, without the old and new rows. <code>FOR EACH ROW</code> triggers are called once for each inserted, updated, or deleted row.</p><p>The trigger need to be created in the same schema as the table. The schema name does not need to be specified when creating the trigger.</p><p>This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
CREATE TRIGGER TRIG_INS BEFORE INSERT ON TEST FOR EACH ROW CALL &quot;MyTrigger&quot;</p>

<h3 id="create_user" class="notranslate" onclick="switchBnf(this)">CREATE USER</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
CREATE USER [ IF NOT EXISTS ] <a href="grammar.html#name">newUserName</a>
{ PASSWORD <a href="grammar.html#string">string</a> | SALT <a href="grammar.html#bytes">bytes</a> HASH <a href="grammar.html#bytes">bytes</a> } [ ADMIN ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">CREATE USER</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IF NOT EXISTS</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#name">newUserName</a></code></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">PASSWORD <a href="grammar.html#string">string</a></code></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">SALT <a href="grammar.html#bytes">bytes</a> HASH <a href="grammar.html#bytes">bytes</a></code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">ADMIN</code></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
CREATE USER [ IF NOT EXISTS ] <a href="grammar.html#name">newUserName</a>
{ PASSWORD <a href="grammar.html#string">string</a> | SALT <a href="grammar.html#bytes">bytes</a> HASH <a href="grammar.html#bytes">bytes</a> } [ ADMIN ]
</pre>
syntax-end -->
<p>Creates a new user. For compatibility, only unquoted or uppercase user names are allowed. The password must be in single quotes. It is case sensitive and can contain spaces. The salt and hash values are hex strings.</p><p>Admin rights are required to execute this command. This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
CREATE USER GUEST PASSWORD &#39;abc&#39;</p>

<h3 id="create_view" class="notranslate" onclick="switchBnf(this)">CREATE VIEW</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
CREATE [ OR REPLACE ] [ FORCE ] VIEW [ IF NOT EXISTS ] <a href="grammar.html#name">newViewName</a>
[ ( <a href="grammar.html#name">columnName</a> [,...] ) ] AS <a href="grammar.html#select">select</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">CREATE</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">OR REPLACE</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">FORCE</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">VIEW</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IF NOT EXISTS</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#name">newViewName</a></code></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">( <a href="grammar.html#name">columnName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">AS <a href="grammar.html#select">select</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
CREATE [ OR REPLACE ] [ FORCE ] VIEW [ IF NOT EXISTS ] <a href="grammar.html#name">newViewName</a>
[ ( <a href="grammar.html#name">columnName</a> [,...] ) ] AS <a href="grammar.html#select">select</a>
</pre>
syntax-end -->
<p>Creates a new view. If the force option is used, then the view is created even if the underlying table(s) don&#39;t exist.</p><p>If the <code>OR REPLACE</code> clause is used an existing view will be replaced, and any dependent views will not need to be recreated. If dependent views will become invalid as a result of the change an error will be generated, but this error can be ignored if the <code>FORCE</code> clause is also used.</p><p>Views are not updatable except when using &#39;instead of&#39; triggers.</p><p>Admin rights are required to execute this command. This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
CREATE VIEW TEST_VIEW AS SELECT * FROM TEST WHERE ID &lt; 100</p>

<h3 id="drop_aggregate" class="notranslate" onclick="switchBnf(this)">DROP AGGREGATE</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
DROP AGGREGATE [ IF EXISTS ] <a href="grammar.html#name">aggregateName</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">DROP AGGREGATE</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IF EXISTS</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#name">aggregateName</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
DROP AGGREGATE [ IF EXISTS ] <a href="grammar.html#name">aggregateName</a>
</pre>
syntax-end -->
<p>Drops an existing user-defined aggregate function.</p><p>Admin rights are required to execute this command. This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
DROP AGGREGATE MEDIAN</p>

<h3 id="drop_alias" class="notranslate" onclick="switchBnf(this)">DROP ALIAS</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
DROP ALIAS [ IF EXISTS ] <a href="grammar.html#name">existingFunctionAliasName</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">DROP ALIAS</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IF EXISTS</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#name">existingFunctionAliasName</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
DROP ALIAS [ IF EXISTS ] <a href="grammar.html#name">existingFunctionAliasName</a>
</pre>
syntax-end -->
<p>Drops an existing function alias.</p><p>Admin rights are required to execute this command. This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
DROP ALIAS MY_SQRT</p>

<h3 id="drop_all_objects" class="notranslate" onclick="switchBnf(this)">DROP ALL OBJECTS</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
DROP ALL OBJECTS [ DELETE FILES ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">DROP ALL OBJECTS</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">DELETE FILES</code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
DROP ALL OBJECTS [ DELETE FILES ]
</pre>
syntax-end -->
<p>Drops all existing views, tables, sequences, schemas, function aliases, roles, user-defined aggregate functions, domains, and users (except the current user). If <code>DELETE FILES</code> is specified, the database files will be removed when the last user disconnects from the database. Warning: this command can not be rolled back.</p><p>Admin rights are required to execute this command.</p>
<p>Example:</p>
<p class="notranslate">
DROP ALL OBJECTS</p>

<h3 id="drop_constant" class="notranslate" onclick="switchBnf(this)">DROP CONSTANT</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
DROP CONSTANT [ IF EXISTS ] <a href="grammar.html#name">constantName</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">DROP CONSTANT</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IF EXISTS</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#name">constantName</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
DROP CONSTANT [ IF EXISTS ] <a href="grammar.html#name">constantName</a>
</pre>
syntax-end -->
<p>Drops a constant. This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
DROP CONSTANT ONE</p>

<h3 id="drop_domain" class="notranslate" onclick="switchBnf(this)">DROP DOMAIN</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
DROP DOMAIN [ IF EXISTS ] <a href="grammar.html#name">domainName</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">DROP DOMAIN</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IF EXISTS</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#name">domainName</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
DROP DOMAIN [ IF EXISTS ] <a href="grammar.html#name">domainName</a>
</pre>
syntax-end -->
<p>Drops a data type (domain). This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
DROP DOMAIN EMAIL</p>

<h3 id="drop_index" class="notranslate" onclick="switchBnf(this)">DROP INDEX</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
DROP INDEX [ IF EXISTS ] <a href="grammar.html#name">indexName</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">DROP INDEX</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IF EXISTS</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#name">indexName</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
DROP INDEX [ IF EXISTS ] <a href="grammar.html#name">indexName</a>
</pre>
syntax-end -->
<p>Drops an index. This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
DROP INDEX IF EXISTS IDXNAME</p>

<h3 id="drop_role" class="notranslate" onclick="switchBnf(this)">DROP ROLE</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
DROP ROLE [ IF EXISTS ] <a href="grammar.html#name">roleName</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">DROP ROLE</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IF EXISTS</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#name">roleName</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
DROP ROLE [ IF EXISTS ] <a href="grammar.html#name">roleName</a>
</pre>
syntax-end -->
<p>Drops a role. This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
DROP ROLE READONLY</p>

<h3 id="drop_schema" class="notranslate" onclick="switchBnf(this)">DROP SCHEMA</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
DROP SCHEMA [ IF EXISTS ] <a href="grammar.html#name">schemaName</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">DROP SCHEMA</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IF EXISTS</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#name">schemaName</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
DROP SCHEMA [ IF EXISTS ] <a href="grammar.html#name">schemaName</a>
</pre>
syntax-end -->
<p>Drops a schema. This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
DROP SCHEMA TEST_SCHEMA</p>

<h3 id="drop_sequence" class="notranslate" onclick="switchBnf(this)">DROP SEQUENCE</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
DROP SEQUENCE [ IF EXISTS ] <a href="grammar.html#name">sequenceName</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">DROP SEQUENCE</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IF EXISTS</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#name">sequenceName</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
DROP SEQUENCE [ IF EXISTS ] <a href="grammar.html#name">sequenceName</a>
</pre>
syntax-end -->
<p>Drops a sequence. This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
DROP SEQUENCE SEQ_ID</p>

<h3 id="drop_table" class="notranslate" onclick="switchBnf(this)">DROP TABLE</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
DROP TABLE [ IF EXISTS ] <a href="grammar.html#name">tableName</a> [,...] [ RESTRICT | CASCADE ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">DROP TABLE</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IF EXISTS</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#name">tableName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">RESTRICT</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">CASCADE</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
DROP TABLE [ IF EXISTS ] <a href="grammar.html#name">tableName</a> [,...] [ RESTRICT | CASCADE ]
</pre>
syntax-end -->
<p>Drops an existing table, or a list of tables. The command will fail if dependent views exist and the <code>RESTRICT</code> clause is used (the default). All dependent views are dropped as well if the <code>CASCADE</code> clause is used. This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
DROP TABLE TEST</p>

<h3 id="drop_trigger" class="notranslate" onclick="switchBnf(this)">DROP TRIGGER</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
DROP TRIGGER [ IF EXISTS ] <a href="grammar.html#name">triggerName</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">DROP TRIGGER</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IF EXISTS</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#name">triggerName</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
DROP TRIGGER [ IF EXISTS ] <a href="grammar.html#name">triggerName</a>
</pre>
syntax-end -->
<p>Drops an existing trigger. This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
DROP TRIGGER TRIG_INS</p>

<h3 id="drop_user" class="notranslate" onclick="switchBnf(this)">DROP USER</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
DROP USER [ IF EXISTS ] <a href="grammar.html#name">userName</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">DROP USER</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IF EXISTS</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#name">userName</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
DROP USER [ IF EXISTS ] <a href="grammar.html#name">userName</a>
</pre>
syntax-end -->
<p>Drops a user. The current user cannot be dropped. For compatibility, only unquoted or uppercase user names are allowed.</p><p>Admin rights are required to execute this command. This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
DROP USER TOM</p>

<h3 id="drop_view" class="notranslate" onclick="switchBnf(this)">DROP VIEW</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
DROP VIEW [ IF EXISTS ] <a href="grammar.html#name">viewName</a> [ RESTRICT | CASCADE ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">DROP VIEW</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IF EXISTS</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#name">viewName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">RESTRICT</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">CASCADE</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
DROP VIEW [ IF EXISTS ] <a href="grammar.html#name">viewName</a> [ RESTRICT | CASCADE ]
</pre>
syntax-end -->
<p>Drops an existing view. All dependent views are dropped as well if the <code>CASCADE</code> clause is used (the default). The command will fail if dependent views exist and the <code>RESTRICT</code> clause is used. This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
DROP VIEW TEST_VIEW</p>

<h3 id="truncate_table" class="notranslate" onclick="switchBnf(this)">TRUNCATE TABLE</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
TRUNCATE TABLE <a href="grammar.html#name">tableName</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">TRUNCATE TABLE <a href="grammar.html#name">tableName</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
TRUNCATE TABLE <a href="grammar.html#name">tableName</a>
</pre>
syntax-end -->
<p>Removes all rows from a table. Unlike <code>DELETE FROM</code> without where clause, this command can not be rolled back. This command is faster than <code>DELETE</code> without where clause. Only regular data tables without foreign key constraints can be truncated (except if referential integrity is disabled for this database or for this table). Linked tables can&#39;t be truncated.</p><p>This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
TRUNCATE TABLE TEST</p>

<h3 id="checkpoint" class="notranslate" onclick="switchBnf(this)">CHECKPOINT</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
CHECKPOINT
</pre>
<div name="railroad">
<code class="c">CHECKPOINT</code>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
CHECKPOINT
</pre>
syntax-end -->
<p>Flushes the data to disk and switches to a new transaction log if possible.</p><p>Admin rights are required to execute this command.</p>
<p>Example:</p>
<p class="notranslate">
CHECKPOINT</p>

<h3 id="checkpoint_sync" class="notranslate" onclick="switchBnf(this)">CHECKPOINT SYNC</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
CHECKPOINT SYNC
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">CHECKPOINT SYNC</code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
CHECKPOINT SYNC
</pre>
syntax-end -->
<p>Flushes the data to disk and and forces all system buffers be written to the underlying device.</p><p>Admin rights are required to execute this command.</p>
<p>Example:</p>
<p class="notranslate">
CHECKPOINT SYNC</p>

<h3 id="commit" class="notranslate" onclick="switchBnf(this)">COMMIT</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
COMMIT [ WORK ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">COMMIT</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">WORK</code></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
COMMIT [ WORK ]
</pre>
syntax-end -->
<p>Commits a transaction.</p>
<p>Example:</p>
<p class="notranslate">
COMMIT</p>

<h3 id="commit_transaction" class="notranslate" onclick="switchBnf(this)">COMMIT TRANSACTION</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
COMMIT TRANSACTION <a href="grammar.html#name">transactionName</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">COMMIT TRANSACTION <a href="grammar.html#name">transactionName</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
COMMIT TRANSACTION <a href="grammar.html#name">transactionName</a>
</pre>
syntax-end -->
<p>Sets the resolution of an in-doubt transaction to &#39;commit&#39;.</p><p>Admin rights are required to execute this command. This command is part of the 2-phase-commit protocol.</p>
<p>Example:</p>
<p class="notranslate">
COMMIT TRANSACTION XID_TEST</p>

<h3 id="grant_right" class="notranslate" onclick="switchBnf(this)">GRANT RIGHT</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
GRANT { SELECT | INSERT | UPDATE | DELETE | ALL } [,...] ON
<a href="grammar.html#name">tableName</a> [,...] TO { PUBLIC | <a href="grammar.html#name">userName</a> | <a href="grammar.html#name">roleName</a> }
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">GRANT</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">SELECT</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">INSERT</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">UPDATE</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">DELETE</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">ALL</code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">ON</code></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#name">tableName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">TO</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">PUBLIC</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#name">userName</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#name">roleName</a></code></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
GRANT { SELECT | INSERT | UPDATE | DELETE | ALL } [,...] ON
<a href="grammar.html#name">tableName</a> [,...] TO { PUBLIC | <a href="grammar.html#name">userName</a> | <a href="grammar.html#name">roleName</a> }
</pre>
syntax-end -->
<p>Grants rights for a table to a user or role.</p><p>Admin rights are required to execute this command. This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
GRANT SELECT ON TEST TO READONLY</p>

<h3 id="grant_role" class="notranslate" onclick="switchBnf(this)">GRANT ROLE</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
GRANT <a href="grammar.html#name">roleName</a> TO { PUBLIC | <a href="grammar.html#name">userName</a> | <a href="grammar.html#name">roleName</a> }
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">GRANT <a href="grammar.html#name">roleName</a> TO</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">PUBLIC</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#name">userName</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#name">roleName</a></code></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
GRANT <a href="grammar.html#name">roleName</a> TO { PUBLIC | <a href="grammar.html#name">userName</a> | <a href="grammar.html#name">roleName</a> }
</pre>
syntax-end -->
<p>Grants a role to a user or role.</p><p>Admin rights are required to execute this command. This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
GRANT READONLY TO PUBLIC</p>

<h3 id="help" class="notranslate" onclick="switchBnf(this)">HELP</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
HELP [ anything [...] ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">HELP</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">anything</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">...</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
HELP [ anything [...] ]
</pre>
syntax-end -->
<p>Displays the help pages of SQL commands or keywords.</p>
<p>Example:</p>
<p class="notranslate">
HELP SELECT</p>

<h3 id="prepare_commit" class="notranslate" onclick="switchBnf(this)">PREPARE COMMIT</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
PREPARE COMMIT <a href="grammar.html#name">newTransactionName</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">PREPARE COMMIT <a href="grammar.html#name">newTransactionName</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
PREPARE COMMIT <a href="grammar.html#name">newTransactionName</a>
</pre>
syntax-end -->
<p>Prepares committing a transaction. This command is part of the 2-phase-commit protocol.</p>
<p>Example:</p>
<p class="notranslate">
PREPARE COMMIT XID_TEST</p>

<h3 id="revoke_right" class="notranslate" onclick="switchBnf(this)">REVOKE RIGHT</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
REVOKE { SELECT | INSERT | UPDATE | DELETE | ALL } [,...] ON
<a href="grammar.html#name">tableName</a> [,...] FROM { PUBLIC | <a href="grammar.html#name">userName</a> | <a href="grammar.html#name">roleName</a> }
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">REVOKE</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">SELECT</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">INSERT</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">UPDATE</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">DELETE</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">ALL</code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">ON</code></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#name">tableName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">FROM</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">PUBLIC</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#name">userName</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#name">roleName</a></code></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
REVOKE { SELECT | INSERT | UPDATE | DELETE | ALL } [,...] ON
<a href="grammar.html#name">tableName</a> [,...] FROM { PUBLIC | <a href="grammar.html#name">userName</a> | <a href="grammar.html#name">roleName</a> }
</pre>
syntax-end -->
<p>Removes rights for a table from a user or role.</p><p>Admin rights are required to execute this command. This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
REVOKE SELECT ON TEST FROM READONLY</p>

<h3 id="revoke_role" class="notranslate" onclick="switchBnf(this)">REVOKE ROLE</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
REVOKE <a href="grammar.html#name">roleName</a> FROM { PUBLIC | <a href="grammar.html#name">userName</a> | <a href="grammar.html#name">roleName</a> }
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">REVOKE <a href="grammar.html#name">roleName</a> FROM</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">PUBLIC</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#name">userName</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#name">roleName</a></code></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
REVOKE <a href="grammar.html#name">roleName</a> FROM { PUBLIC | <a href="grammar.html#name">userName</a> | <a href="grammar.html#name">roleName</a> }
</pre>
syntax-end -->
<p>Removes a role from a user or role.</p><p>Admin rights are required to execute this command. This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
REVOKE READONLY FROM TOM</p>

<h3 id="rollback" class="notranslate" onclick="switchBnf(this)">ROLLBACK</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
ROLLBACK [ TO SAVEPOINT <a href="grammar.html#name">savepointName</a> ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">ROLLBACK</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">TO SAVEPOINT <a href="grammar.html#name">savepointName</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
ROLLBACK [ TO SAVEPOINT <a href="grammar.html#name">savepointName</a> ]
</pre>
syntax-end -->
<p>Rolls back a transaction. If a savepoint name is used, the transaction is only rolled back to the specified savepoint.</p>
<p>Example:</p>
<p class="notranslate">
ROLLBACK</p>

<h3 id="rollback_transaction" class="notranslate" onclick="switchBnf(this)">ROLLBACK TRANSACTION</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
ROLLBACK TRANSACTION <a href="grammar.html#name">transactionName</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">ROLLBACK TRANSACTION <a href="grammar.html#name">transactionName</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
ROLLBACK TRANSACTION <a href="grammar.html#name">transactionName</a>
</pre>
syntax-end -->
<p>Sets the resolution of an in-doubt transaction to &#39;rollback&#39;.</p><p>Admin rights are required to execute this command. This command is part of the 2-phase-commit protocol.</p>
<p>Example:</p>
<p class="notranslate">
ROLLBACK TRANSACTION XID_TEST</p>

<h3 id="savepoint" class="notranslate" onclick="switchBnf(this)">SAVEPOINT</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SAVEPOINT <a href="grammar.html#name">savepointName</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SAVEPOINT <a href="grammar.html#name">savepointName</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SAVEPOINT <a href="grammar.html#name">savepointName</a>
</pre>
syntax-end -->
<p>Create a new savepoint. See also <code>ROLLBACK</code>. Savepoints are only valid until the transaction is committed or rolled back.</p>
<p>Example:</p>
<p class="notranslate">
SAVEPOINT HALF_DONE</p>

<h3 id="set__" class="notranslate" onclick="switchBnf(this)">SET @</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SET <a href="grammar.html#name">@variableName</a> [ = ] <a href="grammar.html#expression">expression</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET <a href="grammar.html#name">@variableName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">=</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#expression">expression</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SET <a href="grammar.html#name">@variableName</a> [ = ] <a href="grammar.html#expression">expression</a>
</pre>
syntax-end -->
<p>Updates a user-defined variable. Variables are not persisted and session scoped, that means only visible from within the session in which they are defined. This command does not commit a transaction, and rollback does not affect it.</p>
<p>Example:</p>
<p class="notranslate">
SET @TOTAL=0</p>

<h3 id="set_allow_literals" class="notranslate" onclick="switchBnf(this)">SET ALLOW_LITERALS</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SET ALLOW_LITERALS { NONE | ALL | NUMBERS }
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET ALLOW_LITERALS</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">NONE</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">ALL</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">NUMBERS</code></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SET ALLOW_LITERALS { NONE | ALL | NUMBERS }
</pre>
syntax-end -->
<p>This setting can help solve the SQL injection problem. By default, text and number literals are allowed in SQL statements. However, this enables SQL injection if the application dynamically builds SQL statements. SQL injection is not possible if user data is set using parameters (&#39;?&#39;).</p><p><code>NONE</code> means literals of any kind are not allowed, only parameters and constants are allowed. <code>NUMBERS</code> mean only numerical and boolean literals are allowed. <code>ALL</code> means all literals are allowed (default).</p><p>See also <code>CREATE CONSTANT</code>.</p><p>Admin rights are required to execute this command, as it affects all connections. This command commits an open transaction. This setting is persistent. This setting can be appended to the database URL: <code>jdbc:h2:test;ALLOW_LITERALS=NONE</code></p>
<p>Example:</p>
<p class="notranslate">
SET ALLOW_LITERALS NONE</p>

<h3 id="set_autocommit" class="notranslate" onclick="switchBnf(this)">SET AUTOCOMMIT</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SET AUTOCOMMIT { TRUE | ON | FALSE | OFF }
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET AUTOCOMMIT</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">TRUE</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">ON</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">FALSE</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">OFF</code></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SET AUTOCOMMIT { TRUE | ON | FALSE | OFF }
</pre>
syntax-end -->
<p>Switches auto commit on or off. This setting can be appended to the database URL: <code>jdbc:h2:test;AUTOCOMMIT=OFF</code> - however this will not work as expected when using a connection pool (the connection pool manager will re-enable autocommit when returning the connection to the pool, so autocommit will only be disabled the first time the connection is used.</p>
<p>Example:</p>
<p class="notranslate">
SET AUTOCOMMIT OFF</p>

<h3 id="set_cache_size" class="notranslate" onclick="switchBnf(this)">SET CACHE_SIZE</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SET CACHE_SIZE <a href="grammar.html#int">int</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET CACHE_SIZE <a href="grammar.html#int">int</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SET CACHE_SIZE <a href="grammar.html#int">int</a>
</pre>
syntax-end -->
<p>Sets the size of the cache in KB (each KB being 1024 bytes) for the current database. The default value is 16384 (16 MB). The value is rounded to the next higher power of two. Depending on the virtual machine, the actual memory required may be higher.</p><p>This setting is persistent and affects all connections as there is only one cache per database. Using a very small value (specially 0) will reduce performance a lot. This setting only affects the database engine (the server in a client/server environment). It has no effect for in-memory databases.</p><p>Admin rights are required to execute this command, as it affects all connections. This command commits an open transaction. This setting is persistent. This setting can be appended to the database URL: <code>jdbc:h2:test;CACHE_SIZE=8192</code></p>
<p>Example:</p>
<p class="notranslate">
SET CACHE_SIZE 8192</p>

<h3 id="set_cluster" class="notranslate" onclick="switchBnf(this)">SET CLUSTER</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SET CLUSTER <a href="grammar.html#string">serverListString</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET CLUSTER <a href="grammar.html#string">serverListString</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SET CLUSTER <a href="grammar.html#string">serverListString</a>
</pre>
syntax-end -->
<p>This command should not be used directly by an application, the statement is executed automatically by the system. The behavior may change in future releases. Sets the cluster server list. An empty string switches off the cluster mode. Switching on the cluster mode requires admin rights, but any user can switch it off (this is automatically done when the client detects the other server is not responding).</p><p>This command is effective immediately, but does not commit an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
SET CLUSTER &#39;&#39;</p>

<h3 id="set_collation" class="notranslate" onclick="switchBnf(this)">SET COLLATION</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SET [ DATABASE ] COLLATION
{ OFF | <a href="grammar.html#name">collationName</a> [ STRENGTH { PRIMARY | SECONDARY | TERTIARY | IDENTICAL } ] }
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">DATABASE</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">COLLATION</code></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">OFF</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#name">collationName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">STRENGTH</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">PRIMARY</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">SECONDARY</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">TERTIARY</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">IDENTICAL</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SET [ DATABASE ] COLLATION
{ OFF | <a href="grammar.html#name">collationName</a> [ STRENGTH { PRIMARY | SECONDARY | TERTIARY | IDENTICAL } ] }
</pre>
syntax-end -->
<p>Sets the collation used for comparing strings. This command can only be executed if there are no tables defined. See <code>java.text.Collator</code> for details about the supported collations and the <code>STRENGTH</code> (<code>PRIMARY</code> is usually case- and umlaut-insensitive; <code>SECONDARY</code> is case-insensitive but umlaut-sensitive; <code>TERTIARY</code> is both case- and umlaut-sensitive; <code>IDENTICAL</code> is sensitive to all differences and only affects ordering).</p><p>The <code>ICU4J</code> collator is used if it is in the classpath. It is also used if the collation name starts with <code>ICU4J_</code> (in that case, the <code>ICU4J</code> must be in the classpath, otherwise an exception is thrown). The default collator is used if the collation name starts with <code>DEFAULT_</code> (even if <code>ICU4J</code> is in the classpath).</p><p>Admin rights are required to execute this command. This command commits an open transaction. This setting is persistent.</p>
<p>Example:</p>
<p class="notranslate">
SET COLLATION ENGLISH</p>

<h3 id="set_compress_lob" class="notranslate" onclick="switchBnf(this)">SET COMPRESS_LOB</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SET COMPRESS_LOB { NO | LZF | DEFLATE }
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET COMPRESS_LOB</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">NO</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">LZF</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">DEFLATE</code></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SET COMPRESS_LOB { NO | LZF | DEFLATE }
</pre>
syntax-end -->
<p>Sets the compression algorithm for <code>BLOB</code> and <code>CLOB</code> data. Compression is usually slower, but needs less disk space. <code>LZF</code> is faster but uses more space.</p><p>Admin rights are required to execute this command, as it affects all connections. This command commits an open transaction. This setting is persistent.</p>
<p>Example:</p>
<p class="notranslate">
SET COMPRESS_LOB LZF</p>

<h3 id="set_database_event_listener" class="notranslate" onclick="switchBnf(this)">SET DATABASE_EVENT_LISTENER</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SET DATABASE_EVENT_LISTENER <a href="grammar.html#string">classNameString</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET DATABASE_EVENT_LISTENER <a href="grammar.html#string">classNameString</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SET DATABASE_EVENT_LISTENER <a href="grammar.html#string">classNameString</a>
</pre>
syntax-end -->
<p>Sets the event listener class. An empty string (&#39;&#39;) means no listener should be used. This setting is not persistent.</p><p>Admin rights are required to execute this command, except if it is set when opening the database (in this case it is reset just after opening the database). This setting can be appended to the database URL: <code>jdbc:h2:test;DATABASE_EVENT_LISTENER=&#39;sample.MyListener&#39;</code></p>
<p>Example:</p>
<p class="notranslate">
SET DATABASE_EVENT_LISTENER &#39;sample.MyListener&#39;</p>

<h3 id="set_db_close_delay" class="notranslate" onclick="switchBnf(this)">SET DB_CLOSE_DELAY</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SET DB_CLOSE_DELAY <a href="grammar.html#int">int</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET DB_CLOSE_DELAY <a href="grammar.html#int">int</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SET DB_CLOSE_DELAY <a href="grammar.html#int">int</a>
</pre>
syntax-end -->
<p>Sets the delay for closing a database if all connections are closed. The value -1 means the database is never closed until the close delay is set to some other value or <code>SHUTDOWN</code> is called. The value 0 means no delay (default; the database is closed if the last connection to it is closed). Values 1 and larger mean the number of seconds the database is left open after closing the last connection.</p><p>If the application exits normally or System.exit is called, the database is closed immediately, even if a delay is set.</p><p>Admin rights are required to execute this command, as it affects all connections. This command commits an open transaction. This setting is persistent. This setting can be appended to the database URL: <code>jdbc:h2:test;DB_CLOSE_DELAY=-1</code></p>
<p>Example:</p>
<p class="notranslate">
SET DB_CLOSE_DELAY -1</p>

<h3 id="set_default_lock_timeout" class="notranslate" onclick="switchBnf(this)">SET DEFAULT_LOCK_TIMEOUT</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SET DEFAULT LOCK_TIMEOUT <a href="grammar.html#int">int</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET DEFAULT LOCK_TIMEOUT <a href="grammar.html#int">int</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SET DEFAULT LOCK_TIMEOUT <a href="grammar.html#int">int</a>
</pre>
syntax-end -->
<p>Sets the default lock timeout (in milliseconds) in this database that is used for the new sessions. The default value for this setting is 1000 (one second).</p><p>Admin rights are required to execute this command, as it affects all connections. This command commits an open transaction. This setting is persistent.</p>
<p>Example:</p>
<p class="notranslate">
SET DEFAULT_LOCK_TIMEOUT 5000</p>

<h3 id="set_default_table_type" class="notranslate" onclick="switchBnf(this)">SET DEFAULT_TABLE_TYPE</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SET DEFAULT_TABLE_TYPE { MEMORY | CACHED }
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET DEFAULT_TABLE_TYPE</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">MEMORY</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">CACHED</code></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SET DEFAULT_TABLE_TYPE { MEMORY | CACHED }
</pre>
syntax-end -->
<p>Sets the default table storage type that is used when creating new tables. Memory tables are kept fully in the main memory (including indexes), however the data is still stored in the database file. The size of memory tables is limited by the memory. The default is <code>CACHED</code>.</p><p>Admin rights are required to execute this command, as it affects all connections. This command commits an open transaction. This setting is persistent. It has no effect for in-memory databases.</p>
<p>Example:</p>
<p class="notranslate">
SET DEFAULT_TABLE_TYPE MEMORY</p>

<h3 id="set_exclusive" class="notranslate" onclick="switchBnf(this)">SET EXCLUSIVE</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SET EXCLUSIVE { 0 | 1 | 2 }
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET EXCLUSIVE</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">0</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">1</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">2</code></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SET EXCLUSIVE { 0 | 1 | 2 }
</pre>
syntax-end -->
<p>Switched the database to exclusive mode (1, 2) and back to normal mode (0).</p><p>In exclusive mode, new connections are rejected, and operations by other connections are paused until the exclusive mode is disabled. When using the value 1, existing connections stay open. When using the value 2, all existing connections are closed (and current transactions are rolled back) except the connection that executes <code>SET EXCLUSIVE</code>. Only the connection that set the exclusive mode can disable it. When the connection is closed, it is automatically disabled.</p><p>Admin rights are required to execute this command. This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
SET EXCLUSIVE 1</p>

<h3 id="set_ignorecase" class="notranslate" onclick="switchBnf(this)">SET IGNORECASE</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SET IGNORECASE { TRUE | FALSE }
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET IGNORECASE</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">TRUE</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">FALSE</code></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SET IGNORECASE { TRUE | FALSE }
</pre>
syntax-end -->
<p>If <code>IGNORECASE</code> is enabled, text columns in newly created tables will be case-insensitive. Already existing tables are not affected. The effect of case-insensitive columns is similar to using a collation with strength <code>PRIMARY</code>. Case-insensitive columns are compared faster than when using a collation. String literals and parameters are however still considered case sensitive even if this option is set.</p><p>Admin rights are required to execute this command, as it affects all connections. This command commits an open transaction. This setting is persistent. This setting can be appended to the database URL: <code>jdbc:h2:test;IGNORECASE=TRUE</code></p>
<p>Example:</p>
<p class="notranslate">
SET IGNORECASE TRUE</p>

<h3 id="set_log" class="notranslate" onclick="switchBnf(this)">SET LOG</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SET LOG <a href="grammar.html#int">int</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET LOG <a href="grammar.html#int">int</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SET LOG <a href="grammar.html#int">int</a>
</pre>
syntax-end -->
<p>Sets the transaction log mode. The values 0, 1, and 2 are supported, the default is 2. This setting affects all connections.</p><p><code>LOG</code> 0 means the transaction log is disabled completely. It is the fastest mode, but also the most dangerous: if the process is killed while the database is open in this mode, the data might be lost. It must only be used if this is not a problem, for example when initially loading a database, or when running tests.</p><p><code>LOG</code> 1 means the transaction log is enabled, but FileDescriptor.sync is disabled. This setting is about half as fast as with <code>LOG</code> 0. This setting is useful if no protection against power failure is required, but the data must be protected against killing the process.</p><p><code>LOG</code> 2 (the default) means the transaction log is enabled, and FileDescriptor.sync is called for each checkpoint. This setting is about half as fast as <code>LOG</code> 1. Depending on the file system, this will also protect against power failure in the majority if cases.</p><p>Admin rights are required to execute this command, as it affects all connections. This command commits an open transaction. This setting is not persistent. This setting can be appended to the database URL: <code>jdbc:h2:test;LOG=0</code></p>
<p>Example:</p>
<p class="notranslate">
SET LOG 1</p>

<h3 id="set_lock_mode" class="notranslate" onclick="switchBnf(this)">SET LOCK_MODE</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SET LOCK_MODE <a href="grammar.html#int">int</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET LOCK_MODE <a href="grammar.html#int">int</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SET LOCK_MODE <a href="grammar.html#int">int</a>
</pre>
syntax-end -->
<p>Sets the lock mode. The values 0, 1, 2, and 3 are supported. The default is 3 (<code>READ_COMMITTED</code>). This setting affects all connections.</p><p>The value 0 means no locking (should only be used for testing; also known as <code>READ_UNCOMMITTED</code>). Please note that using <code>SET LOCK_MODE</code> 0 while at the same time using multiple connections may result in inconsistent transactions.</p><p>The value 1 means table level locking (also known as <code>SERIALIZABLE</code>).</p><p>The value 2 means table level locking with garbage collection (if the application does not close all connections).</p><p>The value 3 means table level locking, but read locks are released immediately (default; also known as <code>READ_COMMITTED</code>).</p><p>Admin rights are required to execute this command, as it affects all connections. This command commits an open transaction. This setting is persistent. This setting can be appended to the database URL: <code>jdbc:h2:test;LOCK_MODE=3</code></p>
<p>Example:</p>
<p class="notranslate">
SET LOCK_MODE 1</p>

<h3 id="set_lock_timeout" class="notranslate" onclick="switchBnf(this)">SET LOCK_TIMEOUT</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SET LOCK_TIMEOUT <a href="grammar.html#int">int</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET LOCK_TIMEOUT <a href="grammar.html#int">int</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SET LOCK_TIMEOUT <a href="grammar.html#int">int</a>
</pre>
syntax-end -->
<p>Sets the lock timeout (in milliseconds) for the current session. The default value for this setting is 1000 (one second).</p><p>This command does not commit a transaction, and rollback does not affect it. This setting can be appended to the database URL: <code>jdbc:h2:test;LOCK_TIMEOUT=10000</code></p>
<p>Example:</p>
<p class="notranslate">
SET LOCK_TIMEOUT 1000</p>

<h3 id="set_max_length_inplace_lob" class="notranslate" onclick="switchBnf(this)">SET MAX_LENGTH_INPLACE_LOB</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SET MAX_LENGTH_INPLACE_LOB <a href="grammar.html#int">int</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET MAX_LENGTH_INPLACE_LOB <a href="grammar.html#int">int</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SET MAX_LENGTH_INPLACE_LOB <a href="grammar.html#int">int</a>
</pre>
syntax-end -->
<p>Sets the maximum size of an in-place <code>LOB</code> object. <code>LOB</code> objects larger that this size are stored in a separate file, otherwise stored directly in the database (in-place). The default max size is 1024. This setting has no effect for in-memory databases.</p><p>Admin rights are required to execute this command, as it affects all connections. This command commits an open transaction. This setting is persistent.</p>
<p>Example:</p>
<p class="notranslate">
SET MAX_LENGTH_INPLACE_LOB 128</p>

<h3 id="set_max_log_size" class="notranslate" onclick="switchBnf(this)">SET MAX_LOG_SIZE</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SET MAX_LOG_SIZE <a href="grammar.html#int">int</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET MAX_LOG_SIZE <a href="grammar.html#int">int</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SET MAX_LOG_SIZE <a href="grammar.html#int">int</a>
</pre>
syntax-end -->
<p>Sets the maximum size of the transaction log, in megabytes. If the log is larger, and if there is no open transaction, the transaction log is truncated. If there is an option transaction, the transaction log will continue to grow however. The default max size is 16 MB. This setting has no effect for in-memory databases.</p><p>Admin rights are required to execute this command, as it affects all connections. This command commits an open transaction. This setting is persistent.</p>
<p>Example:</p>
<p class="notranslate">
SET MAX_LOG_SIZE 2</p>

<h3 id="set_max_memory_rows" class="notranslate" onclick="switchBnf(this)">SET MAX_MEMORY_ROWS</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SET MAX_MEMORY_ROWS <a href="grammar.html#int">int</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET MAX_MEMORY_ROWS <a href="grammar.html#int">int</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SET MAX_MEMORY_ROWS <a href="grammar.html#int">int</a>
</pre>
syntax-end -->
<p>The maximum number of rows in a result set that are kept in-memory. If more rows are read, then the rows are buffered to disk. The default value is 10000.</p><p>Admin rights are required to execute this command, as it affects all connections. This command commits an open transaction. This setting is persistent. It has no effect for in-memory databases.</p>
<p>Example:</p>
<p class="notranslate">
SET MAX_MEMORY_ROWS 1000</p>

<h3 id="set_max_memory_undo" class="notranslate" onclick="switchBnf(this)">SET MAX_MEMORY_UNDO</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SET MAX_MEMORY_UNDO <a href="grammar.html#int">int</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET MAX_MEMORY_UNDO <a href="grammar.html#int">int</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SET MAX_MEMORY_UNDO <a href="grammar.html#int">int</a>
</pre>
syntax-end -->
<p>The maximum number of undo records per a session that are kept in-memory. If a transaction is larger, the records are buffered to disk. The default value is 50000. Changes to tables without a primary key can not be buffered to disk. This setting is not supported when using multi-version concurrency.</p><p>Admin rights are required to execute this command, as it affects all connections. This command commits an open transaction. This setting is persistent. It has no effect for in-memory databases.</p>
<p>Example:</p>
<p class="notranslate">
SET MAX_MEMORY_UNDO 1000</p>

<h3 id="set_max_operation_memory" class="notranslate" onclick="switchBnf(this)">SET MAX_OPERATION_MEMORY</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SET MAX_OPERATION_MEMORY <a href="grammar.html#int">int</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET MAX_OPERATION_MEMORY <a href="grammar.html#int">int</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SET MAX_OPERATION_MEMORY <a href="grammar.html#int">int</a>
</pre>
syntax-end -->
<p>Sets the maximum memory used for large operations (delete and insert), in bytes. Operations that use more memory are buffered to disk, slowing down the operation. The default max size is 100000. 0 means no limit.</p><p>This setting is not persistent. Admin rights are required to execute this command, as it affects all connections. It has no effect for in-memory databases. This setting can be appended to the database URL: <code>jdbc:h2:test;MAX_OPERATION_MEMORY=10000</code></p>
<p>Example:</p>
<p class="notranslate">
SET MAX_OPERATION_MEMORY 0</p>

<h3 id="set_mode" class="notranslate" onclick="switchBnf(this)">SET MODE</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SET MODE { REGULAR | DB2 | DERBY | HSQLDB | MSSQLSERVER | MYSQL | ORACLE | POSTGRESQL }
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET MODE</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">REGULAR</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">DB2</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">DERBY</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">HSQLDB</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">MSSQLSERVER</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">MYSQL</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">ORACLE</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">POSTGRESQL</code></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SET MODE { REGULAR | DB2 | DERBY | HSQLDB | MSSQLSERVER | MYSQL | ORACLE | POSTGRESQL }
</pre>
syntax-end -->
<p>Changes to another database compatibility mode. For details, see Compatibility Modes in the feature section.</p><p>This setting is not persistent. Admin rights are required to execute this command, as it affects all connections. This command commits an open transaction. This setting can be appended to the database URL: <code>jdbc:h2:test;MODE=MYSQL</code></p>
<p>Example:</p>
<p class="notranslate">
SET MODE HSQLDB</p>

<h3 id="set_multi_threaded" class="notranslate" onclick="switchBnf(this)">SET MULTI_THREADED</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SET MULTI_THREADED { 0 | 1 }
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET MULTI_THREADED</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">0</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">1</code></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SET MULTI_THREADED { 0 | 1 }
</pre>
syntax-end -->
<p>Enabled (1) or disabled (0) multi-threading inside the database engine. By default, this setting is disabled. Currently, enabling this is experimental only.</p><p>This is a global setting, which means it is not possible to open multiple databases with different modes at the same time in the same virtual machine. This setting is not persistent, however the value is kept until the virtual machine exits or it is changed.</p><p>Admin rights are required to execute this command, as it affects all connections. This command commits an open transaction. This setting can be appended to the database URL: <code>jdbc:h2:test;MULTI_THREADED=1</code></p>
<p>Example:</p>
<p class="notranslate">
SET MULTI_THREADED 1</p>

<h3 id="set_optimize_reuse_results" class="notranslate" onclick="switchBnf(this)">SET OPTIMIZE_REUSE_RESULTS</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SET OPTIMIZE_REUSE_RESULTS { 0 | 1 }
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET OPTIMIZE_REUSE_RESULTS</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">0</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">1</code></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SET OPTIMIZE_REUSE_RESULTS { 0 | 1 }
</pre>
syntax-end -->
<p>Enabled (1) or disabled (0) the result reuse optimization. If enabled, subqueries and views used as subqueries are only re-run if the data in one of the tables was changed. This option is enabled by default.</p><p>Admin rights are required to execute this command, as it affects all connections. This command commits an open transaction. This setting can be appended to the database URL: <code>jdbc:h2:test;OPTIMIZE_REUSE_RESULTS=0</code></p>
<p>Example:</p>
<p class="notranslate">
SET OPTIMIZE_REUSE_RESULTS 0</p>

<h3 id="set_password" class="notranslate" onclick="switchBnf(this)">SET PASSWORD</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SET PASSWORD <a href="grammar.html#string">string</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET PASSWORD <a href="grammar.html#string">string</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SET PASSWORD <a href="grammar.html#string">string</a>
</pre>
syntax-end -->
<p>Changes the password of the current user. The password must be in single quotes. It is case sensitive and can contain spaces.</p><p>This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
SET PASSWORD &#39;abcstzri!.5&#39;</p>

<h3 id="set_query_timeout" class="notranslate" onclick="switchBnf(this)">SET QUERY_TIMEOUT</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SET QUERY_TIMEOUT <a href="grammar.html#int">int</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET QUERY_TIMEOUT <a href="grammar.html#int">int</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SET QUERY_TIMEOUT <a href="grammar.html#int">int</a>
</pre>
syntax-end -->
<p>Set the query timeout of the current session to the given value. The timeout is in milliseconds. All kinds of statements will throw an exception if they take longer than the given value. The default timeout is 0, meaning no timeout.</p><p>This command does not commit a transaction, and rollback does not affect it.</p>
<p>Example:</p>
<p class="notranslate">
SET QUERY_TIMEOUT 10000</p>

<h3 id="set_referential_integrity" class="notranslate" onclick="switchBnf(this)">SET REFERENTIAL_INTEGRITY</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SET REFERENTIAL_INTEGRITY { TRUE | FALSE }
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET REFERENTIAL_INTEGRITY</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">TRUE</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">FALSE</code></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SET REFERENTIAL_INTEGRITY { TRUE | FALSE }
</pre>
syntax-end -->
<p>Disabled or enables referential integrity checking for the whole database. Enabling it does not check existing data. Use <code>ALTER TABLE SET</code> to disable it only for one table.</p><p>This setting is not persistent. This command commits an open transaction. Admin rights are required to execute this command, as it affects all connections.</p>
<p>Example:</p>
<p class="notranslate">
SET REFERENTIAL_INTEGRITY FALSE</p>

<h3 id="set_salt_hash" class="notranslate" onclick="switchBnf(this)">SET SALT HASH</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SET SALT <a href="grammar.html#bytes">bytes</a> HASH <a href="grammar.html#bytes">bytes</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET SALT <a href="grammar.html#bytes">bytes</a> HASH <a href="grammar.html#bytes">bytes</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SET SALT <a href="grammar.html#bytes">bytes</a> HASH <a href="grammar.html#bytes">bytes</a>
</pre>
syntax-end -->
<p>Sets the password salt and hash for the current user. The password must be in single quotes. It is case sensitive and can contain spaces.</p><p>This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
SET SALT &#39;00&#39; HASH &#39;1122&#39;</p>

<h3 id="set_schema" class="notranslate" onclick="switchBnf(this)">SET SCHEMA</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SET SCHEMA <a href="grammar.html#name">schemaName</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET SCHEMA <a href="grammar.html#name">schemaName</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SET SCHEMA <a href="grammar.html#name">schemaName</a>
</pre>
syntax-end -->
<p>Changes the default schema of the current connection. The default schema is used in statements where no schema is set explicitly. The default schema for new connections is <code>PUBLIC</code>.</p><p>This command does not commit a transaction, and rollback does not affect it. This setting can be appended to the database URL: <code>jdbc:h2:test;SCHEMA=ABC</code></p>
<p>Example:</p>
<p class="notranslate">
SET SCHEMA INFORMATION_SCHEMA</p>

<h3 id="set_schema_search_path" class="notranslate" onclick="switchBnf(this)">SET SCHEMA_SEARCH_PATH</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SET SCHEMA_SEARCH_PATH <a href="grammar.html#name">schemaName</a> [,...]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET SCHEMA_SEARCH_PATH <a href="grammar.html#name">schemaName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SET SCHEMA_SEARCH_PATH <a href="grammar.html#name">schemaName</a> [,...]
</pre>
syntax-end -->
<p>Changes the schema search path of the current connection. The default schema is used in statements where no schema is set explicitly. The default schema for new connections is <code>PUBLIC</code>.</p><p>This command does not commit a transaction, and rollback does not affect it. This setting can be appended to the database URL: <code>jdbc:h2:test;SCHEMA_SEARCH_PATH=ABC,DEF</code></p>
<p>Example:</p>
<p class="notranslate">
SET SCHEMA_SEARCH_PATH INFORMATION_SCHEMA, PUBLIC</p>

<h3 id="set_throttle" class="notranslate" onclick="switchBnf(this)">SET THROTTLE</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SET THROTTLE <a href="grammar.html#int">int</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET THROTTLE <a href="grammar.html#int">int</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SET THROTTLE <a href="grammar.html#int">int</a>
</pre>
syntax-end -->
<p>Sets the throttle for the current connection. The value is the number of milliseconds delay after each 50 ms. The default value is 0 (throttling disabled).</p><p>This command does not commit a transaction, and rollback does not affect it. This setting can be appended to the database URL: <code>jdbc:h2:test;THROTTLE=50</code></p>
<p>Example:</p>
<p class="notranslate">
SET THROTTLE 200</p>

<h3 id="set_trace_level" class="notranslate" onclick="switchBnf(this)">SET TRACE_LEVEL</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SET { TRACE_LEVEL_FILE | TRACE_LEVEL_SYSTEM_OUT } <a href="grammar.html#int">int</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">TRACE_LEVEL_FILE</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">TRACE_LEVEL_SYSTEM_OUT</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#int">int</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SET { TRACE_LEVEL_FILE | TRACE_LEVEL_SYSTEM_OUT } <a href="grammar.html#int">int</a>
</pre>
syntax-end -->
<p>Sets the trace level for file the file or system out stream. Levels are: 0=off, 1=error, 2=info, 3=debug. The default level is 1 for file and 0 for system out. To use <code>SLF4J</code>, append <code>;TRACE_LEVEL_FILE=4</code> to the database URL when opening the database.</p><p>This setting is not persistent. Admin rights are required to execute this command, as it affects all connections. This command does not commit a transaction, and rollback does not affect it. This setting can be appended to the database URL: <code>jdbc:h2:test;TRACE_LEVEL_SYSTEM_OUT=3</code></p>
<p>Example:</p>
<p class="notranslate">
SET TRACE_LEVEL_SYSTEM_OUT 3</p>

<h3 id="set_trace_max_file_size" class="notranslate" onclick="switchBnf(this)">SET TRACE_MAX_FILE_SIZE</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SET TRACE_MAX_FILE_SIZE <a href="grammar.html#int">int</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET TRACE_MAX_FILE_SIZE <a href="grammar.html#int">int</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SET TRACE_MAX_FILE_SIZE <a href="grammar.html#int">int</a>
</pre>
syntax-end -->
<p>Sets the maximum trace file size. If the file exceeds the limit, the file is renamed to .old and a new file is created. If another .old file exists, it is deleted. The default max size is 16 MB.</p><p>This setting is persistent. Admin rights are required to execute this command, as it affects all connections. This command commits an open transaction. This setting can be appended to the database URL: <code>jdbc:h2:test;TRACE_MAX_FILE_SIZE=3</code></p>
<p>Example:</p>
<p class="notranslate">
SET TRACE_MAX_FILE_SIZE 10</p>

<h3 id="set_undo_log" class="notranslate" onclick="switchBnf(this)">SET UNDO_LOG</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SET UNDO_LOG <a href="grammar.html#int">int</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET UNDO_LOG <a href="grammar.html#int">int</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SET UNDO_LOG <a href="grammar.html#int">int</a>
</pre>
syntax-end -->
<p>Enables (1) or disables (0) the per session undo log. The undo log is enabled by default. When disabled, transactions can not be rolled back. This setting should only be used for bulk operations that don&#39;t need to be atomic.</p><p>This command commits an open transaction.</p>
<p>Example:</p>
<p class="notranslate">
SET UNDO_LOG 0</p>

<h3 id="set_write_delay" class="notranslate" onclick="switchBnf(this)">SET WRITE_DELAY</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SET WRITE_DELAY <a href="grammar.html#int">int</a>
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET WRITE_DELAY <a href="grammar.html#int">int</a></code></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SET WRITE_DELAY <a href="grammar.html#int">int</a>
</pre>
syntax-end -->
<p>Set the maximum delay between a commit and flushing the log, in milliseconds. This setting is persistent. The default is 500 ms.</p><p>Admin rights are required to execute this command, as it affects all connections. This command commits an open transaction. This setting can be appended to the database URL: <code>jdbc:h2:test;WRITE_DELAY=0</code></p>
<p>Example:</p>
<p class="notranslate">
SET WRITE_DELAY 2000</p>

<h3 id="shutdown" class="notranslate" onclick="switchBnf(this)">SHUTDOWN</h3>
<!-- railroad-start -->
<pre name="bnf" style="display: none">
SHUTDOWN [ IMMEDIATELY | COMPACT | DEFRAG ]
</pre>
<div name="railroad">
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">SHUTDOWN</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">IMMEDIATELY</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">COMPACT</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">DEFRAG</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
</div>
<!-- railroad-end -->
<!-- syntax-start
<pre>
SHUTDOWN [ IMMEDIATELY | COMPACT | DEFRAG ]
</pre>
syntax-end -->
<p>This statement closes all open connections to the database and closes the database. This command is usually not required, as the database is closed automatically when the last connection to it is closed.</p><p>If no option is used, then the database is closed normally. All connections are closed, open transactions are rolled back.</p><p><code>SHUTDOWN COMPACT</code> fully compacts the database (re-creating the database may further reduce the database size). If the database is closed normally (using <code>SHUTDOWN</code> or by closing all connections), then the database is also compacted, but only for at most the time defined by the database setting <code>h2.maxCompactTime</code> in milliseconds (see there).</p><p><code>SHUTDOWN IMMEDIATELY</code> closes the database files without any cleanup and without compacting.</p><p><code>SHUTDOWN DEFRAG</code> re-orders the pages when closing the database so that table scans are faster.</p><p>Admin rights are required to execute this command.</p>
<p>Example:</p>
<p class="notranslate">
SHUTDOWN COMPACT</p>


<h3 id="alias" class="notranslate" onclick="switchBnf(this)">Alias</h3>
<!-- railroad-start -->
<code class="c"><a href="grammar.html#name">name</a></code>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#name">name</a>
</pre>
syntax-end -->
<p>An alias is a name that is only valid in the context of the statement.</p>
<p>Example:</p>
<p class="notranslate">A</p>

<h3 id="and_condition" class="notranslate" onclick="switchBnf(this)">And Condition</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#condition">condition</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">AND <a href="grammar.html#condition">condition</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">...</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#condition">condition</a> [ { AND <a href="grammar.html#condition">condition</a> } [...] ]
</pre>
syntax-end -->
<p>Value or condition.</p>
<p>Example:</p>
<p class="notranslate">ID=1 AND NAME=&#39;Hi&#39;</p>

<h3 id="array" class="notranslate" onclick="switchBnf(this)">Array</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">(</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#expression">expression</a> ,</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#expression">expression</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
( [ <a href="grammar.html#expression">expression</a>, [ <a href="grammar.html#expression">expression</a> [,...] ] ] )
</pre>
syntax-end -->
<p>An array of values. An empty array is &#39;()&#39;. Trailing commas are ignored. An array with one element must contain a comma to be parsed as an array.</p>
<p>Example:</p>
<p class="notranslate">(1, 2)<br />(1, )<br />()</p>

<h3 id="boolean" class="notranslate" onclick="switchBnf(this)">Boolean</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">TRUE</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">FALSE</code></td><td class="le"></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
TRUE | FALSE
</pre>
syntax-end -->
<p>A boolean value.</p>
<p>Example:</p>
<p class="notranslate">TRUE</p>

<h3 id="bytes" class="notranslate" onclick="switchBnf(this)">Bytes</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">X &apos; <a href="grammar.html#hex">hex</a> &apos;</code></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
X&apos;<a href="grammar.html#hex">hex</a>&apos;
</pre>
syntax-end -->
<p>A binary value. The hex value is not case sensitive.</p>
<p>Example:</p>
<p class="notranslate">X&#39;01FF&#39;</p>

<h3 id="case" class="notranslate" onclick="switchBnf(this)">Case</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">CASE <a href="grammar.html#expression">expression</a> WHEN <a href="grammar.html#expression">expression</a> THEN <a href="grammar.html#expression">expression</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">...</code></td><td class="le"></td></tr></table></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">ELSE <a href="grammar.html#expression">expression</a></code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">END</code></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
CASE <a href="grammar.html#expression">expression</a> { WHEN <a href="grammar.html#expression">expression</a> THEN <a href="grammar.html#expression">expression</a> } [...]
[ ELSE <a href="grammar.html#expression">expression</a> ] END
</pre>
syntax-end -->
<p>Returns the first expression where the value is equal to the test expression. If no else part is specified, return <code>NULL</code>.</p>
<p>Example:</p>
<p class="notranslate">CASE CNT WHEN 0 THEN &#39;No&#39; WHEN 1 THEN &#39;One&#39; ELSE &#39;Some&#39; END</p>

<h3 id="case_when" class="notranslate" onclick="switchBnf(this)">Case When</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">CASE WHEN <a href="grammar.html#expression">expression</a> THEN <a href="grammar.html#expression">expression</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">...</code></td><td class="le"></td></tr></table></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">ELSE <a href="grammar.html#expression">expression</a></code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">END</code></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
CASE { WHEN <a href="grammar.html#expression">expression</a> THEN <a href="grammar.html#expression">expression</a>} [...]
[ ELSE <a href="grammar.html#expression">expression</a> ] END
</pre>
syntax-end -->
<p>Returns the first expression where the condition is true. If no else part is specified, return <code>NULL</code>.</p>
<p>Example:</p>
<p class="notranslate">CASE WHEN CNT&lt;10 THEN &#39;Low&#39; ELSE &#39;High&#39; END</p>

<h3 id="cipher" class="notranslate" onclick="switchBnf(this)">Cipher</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">AES</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">XTEA</code></td><td class="le"></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
{ AES | XTEA }
</pre>
syntax-end -->
<p>Two algorithms are supported: <code>AES</code> (<code>AES-128</code>) and <code>XTEA</code> (using 32 rounds). <code>XTEA</code> is a bit faster than <code>AES</code> in some environments, but <code>AES</code> is more secure.</p>
<p>Example:</p>
<p class="notranslate">AES</p>

<h3 id="column_definition" class="notranslate" onclick="switchBnf(this)">Column Definition</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#name">columnName</a> <a href="grammar.html#data_type">dataType</a></code></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">DEFAULT <a href="grammar.html#expression">expression</a></code></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">AS <a href="grammar.html#expression">computedColumnExpression</a></code></td></tr></table></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">NOT</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">NULL</code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">AUTO_INCREMENT</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">IDENTITY</code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">( <a href="grammar.html#int">startInt</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">, <a href="grammar.html#int">incrementInt</a></code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">SELECTIVITY <a href="functions.html#selectivity">selectivity</a></code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">COMMENT <a href="grammar.html#expression">expression</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">PRIMARY KEY</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">HASH</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">UNIQUE</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">CHECK <a href="grammar.html#condition">condition</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#name">columnName</a> <a href="grammar.html#data_type">dataType</a>
[ { DEFAULT <a href="grammar.html#expression">expression</a> | AS <a href="grammar.html#expression">computedColumnExpression</a> } ] [ [ NOT ] NULL ]
[ { AUTO_INCREMENT | IDENTITY } [ ( <a href="grammar.html#int">startInt</a> [, <a href="grammar.html#int">incrementInt</a> ] ) ] ]
[ SELECTIVITY <a href="functions.html#selectivity">selectivity</a> ] [ COMMENT <a href="grammar.html#expression">expression</a> ]
[ PRIMARY KEY [ HASH ] | UNIQUE ] [ CHECK <a href="grammar.html#condition">condition</a> ]
</pre>
syntax-end -->
<p>Default expressions are used if no explicit value was used when adding a row. The computed column expression is evaluated and assigned whenever the row changes.</p><p>Identity and auto-increment columns are columns with a sequence as the default. The column declared as the identity columns is implicitly the primary key column of this table (unlike auto-increment columns).</p><p>The options <code>PRIMARY KEY, UNIQUE</code>, and <code>CHECK</code> are not supported for <code>ALTER</code> statements.</p><p>Check constraints can reference columns of the table, and they can reference objects that exist while the statement is executed. Conditions are only checked when a row is added or modified in the table where the constraint exists.</p>
<p>Example:</p>
<p class="notranslate">CREATE TABLE TEST(ID INT PRIMARY KEY, NAME VARCHAR(255) DEFAULT &#39;&#39;);<br />CREATE TABLE TEST(ID BIGINT IDENTITY);<br />CREATE TABLE TEST(QUANTITY INT, PRICE DECIMAL, AMOUNT DECIMAL AS QUANTITY*PRICE);</p>

<h3 id="comments" class="notranslate" onclick="switchBnf(this)">Comments</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">- - anything</code></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">/ / anything</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">/ * anything * /</code></td></tr></table></td><td class="le"></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
&#45;- anything | // anything | /* anything */
</pre>
syntax-end -->
<p>Comments can be used anywhere in a command and are ignored by the database. Line comments end with a newline. Block comments cannot be nested, but can be multiple lines long.</p>
<p>Example:</p>
<p class="notranslate">// This is a comment</p>

<h3 id="compare" class="notranslate" onclick="switchBnf(this)">Compare</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">&lt; &gt;</code></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">&lt; =</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">&gt; =</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">=</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">&lt;</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">&gt;</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">! =</code></td></tr></table></td><td class="le"></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
&lt;&gt; | &lt;= | &gt;= | = | &lt; | &gt; | !=
</pre>
syntax-end -->
<p>Comparison operator. The operator != is the same as &lt;&gt;.</p>
<p>Example:</p>
<p class="notranslate">&lt;&gt;</p>

<h3 id="condition" class="notranslate" onclick="switchBnf(this)">Condition</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#operand">operand</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#condition_right_hand_side">conditionRightHandSide</a></code></td><td class="le"></td></tr></table></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">NOT <a href="grammar.html#condition">condition</a></code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">EXISTS ( <a href="grammar.html#select">select</a> )</code></td></tr></table></td><td class="le"></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#operand">operand</a> [ <a href="grammar.html#condition_right_hand_side">conditionRightHandSide</a> ] | NOT <a href="grammar.html#condition">condition</a> | EXISTS ( <a href="grammar.html#select">select</a> )
</pre>
syntax-end -->
<p>Boolean value or condition.</p>
<p>Example:</p>
<p class="notranslate">ID&lt;&gt;2</p>

<h3 id="condition_right_hand_side" class="notranslate" onclick="switchBnf(this)">Condition Right Hand Side</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#compare">compare</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">ALL</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">ANY</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">SOME</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">( <a href="grammar.html#select">select</a> )</code></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#operand">operand</a></code></td><td class="le"></td></tr></table></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IS</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">NOT</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">NULL</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IS</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">NOT</code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">DISTINCT FROM</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#operand">operand</a></code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">BETWEEN <a href="grammar.html#operand">operand</a> AND <a href="grammar.html#operand">operand</a></code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IN (</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c"><a href="grammar.html#select">select</a></code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#expression">expression</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">NOT</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">LIKE <a href="grammar.html#operand">operand</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">ESCAPE <a href="grammar.html#string">string</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">NOT</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">REGEXP <a href="grammar.html#operand">operand</a></code></td></tr></table></td><td class="le"></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#compare">compare</a> { { { ALL | ANY | SOME } ( <a href="grammar.html#select">select</a> ) } | <a href="grammar.html#operand">operand</a> }
| IS [ NOT ] NULL
| IS [ NOT ] [ DISTINCT FROM ] <a href="grammar.html#operand">operand</a>
| BETWEEN <a href="grammar.html#operand">operand</a> AND <a href="grammar.html#operand">operand</a>
| IN ( { <a href="grammar.html#select">select</a> | <a href="grammar.html#expression">expression</a> [,...] } )
| [ NOT ] LIKE <a href="grammar.html#operand">operand</a> [ ESCAPE <a href="grammar.html#string">string</a> ]
| [ NOT ] REGEXP <a href="grammar.html#operand">operand</a>
</pre>
syntax-end -->
<p>The right hand side of a condition.</p><p>The conditions <code>IS [ NOT ]</code> and <code>IS [ NOT ] DISTINCT FROM</code> are null-safe, meaning <code>NULL</code> is considered the same as <code>NULL</code>, and the condition never evaluates to <code>NULL</code>.</p><p>When comparing with <code>LIKE</code>, the wildcards characters are <code>_</code> (any one character) and <code>%</code> (any characters). The database uses an index when comparing with <code>LIKE</code> except if the operand starts with a wildcard. To search for the characters <code>%</code> and <code>_</code>, the characters need to be escaped. The default escape character is <code> \ </code> (backslash). To select no escape character, use <code>ESCAPE &#39;&#39;</code> (empty string). At most one escape character is allowed. Each character that follows the escape character in the pattern needs to match exactly. Patterns that end with an escape character are invalid and the expression returns <code>NULL</code>.</p><p>When comparing with <code>REGEXP</code>, regular expression matching is used. See Java <code>Matcher.find</code> for details.</p>
<p>Example:</p>
<p class="notranslate">LIKE &#39;Jo%&#39;</p>

<h3 id="constraint" class="notranslate" onclick="switchBnf(this)">Constraint</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#constraint_name_definition">constraintNameDefinition</a></code></td><td class="le"></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">CHECK <a href="grammar.html#expression">expression</a></code></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">UNIQUE ( <a href="grammar.html#name">columnName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#referential_constraint">referentialConstraint</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">PRIMARY KEY</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">HASH</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">( <a href="grammar.html#name">columnName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td></tr></table></td><td class="le"></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
[ <a href="grammar.html#constraint_name_definition">constraintNameDefinition</a> ]
{ CHECK <a href="grammar.html#expression">expression</a>
| UNIQUE ( <a href="grammar.html#name">columnName</a> [,...] )
| <a href="grammar.html#referential_constraint">referentialConstraint</a>
| PRIMARY KEY [ HASH ] ( <a href="grammar.html#name">columnName</a> [,...] ) }
</pre>
syntax-end -->
<p>Defines a constraint. The check condition must evaluate to <code>TRUE, FALSE</code> or <code>NULL</code>. <code>TRUE</code> and <code>NULL</code> mean the operation is to be permitted, and <code>FALSE</code> means the operation is to be rejected. To prevent <code>NULL</code> in a column, use <code>NOT NULL</code> instead of a check constraint.</p>
<p>Example:</p>
<p class="notranslate">PRIMARY KEY(ID, NAME)</p>

<h3 id="constraint_name_definition" class="notranslate" onclick="switchBnf(this)">Constraint Name Definition</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">CONSTRAINT</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">IF NOT EXISTS</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#name">newConstraintName</a></code></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
CONSTRAINT [ IF NOT EXISTS ] <a href="grammar.html#name">newConstraintName</a>
</pre>
syntax-end -->
<p>Defines a constraint name.</p>
<p>Example:</p>
<p class="notranslate">CONSTRAINT CONST_ID</p>

<h3 id="csv_options" class="notranslate" onclick="switchBnf(this)">Csv Options</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#string">charsetString</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">, <a href="grammar.html#string">fieldSepString</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">, <a href="grammar.html#string">fieldDelimString</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">, <a href="grammar.html#string">escString</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">, <a href="grammar.html#string">nullString</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#string">charsetString</a> [, <a href="grammar.html#string">fieldSepString</a> [, <a href="grammar.html#string">fieldDelimString</a> [, <a href="grammar.html#string">escString</a> [, <a href="grammar.html#string">nullString</a>]]]]]
| <a href="grammar.html#string">optionString</a>
</pre>
syntax-end -->
<p>Optional parameters for <code>CSVREAD</code> and <code>CSVWRITE</code>. Instead of setting the options one by one, all options can be combined into a space separated key-value pairs, as follows: <code>STRINGDECODE(&#39;charset=UTF-8 escape=\" fieldDelimiter=\" fieldSeparator=, &#39; || &#39;lineComment=# lineSeparator=\n null= rowSeparator=&#39;)</code>. The following options are supported: <code>caseSensitiveColumnNames</code> (true or false; disabled by default), <code>charset, escape, fieldDelimiter, fieldSeparator, lineComment</code> (disabled by default), <code>lineSeparator, null, rowSeparator</code> (not set by default), <code>preserveWhitespace</code> (true or false; disabled by default), <code>writeColumnHeader</code> (true or false; enabled by default). For a newline or other special character, use <code>STRINGDECODE</code> as in the example above. A space needs to be escaped with a backslash (<code>&#39;\ &#39;</code>), and a backslash needs to be escaped with another backslash (<code>&#39;\\&#39;</code>). All other characters are not to be escaped, that means newline and tab characters are written as such.</p>
<p>Example:</p>
<p class="notranslate">CALL CSVWRITE(&#39;test2.csv&#39;, &#39;SELECT * FROM TEST&#39;, &#39;charset=UTF-8 fieldSeparator=|&#39;);</p>

<h3 id="data_type" class="notranslate" onclick="switchBnf(this)">Data Type</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c"><a href="datatypes.html#int_type">intType</a></code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#boolean_type">booleanType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#tinyint_type">tinyintType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#smallint_type">smallintType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#bigint_type">bigintType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#identity_type">identityType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#decimal_type">decimalType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#double_type">doubleType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#real_type">realType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#date_type">dateType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#time_type">timeType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#timestamp_type">timestampType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#binary_type">binaryType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#other_type">otherType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#varchar_type">varcharType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#varchar_ignorecase_type">varcharIgnorecaseType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#char_type">charType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#blob_type">blobType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#clob_type">clobType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="datatypes.html#uuid_type">uuidType</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="datatypes.html#array_type">arrayType</a></code></td><td class="le"></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="datatypes.html#int_type">intType</a> | <a href="datatypes.html#boolean_type">booleanType</a> | <a href="datatypes.html#tinyint_type">tinyintType</a> | <a href="datatypes.html#smallint_type">smallintType</a> | <a href="datatypes.html#bigint_type">bigintType</a> | <a href="datatypes.html#identity_type">identityType</a>
| <a href="datatypes.html#decimal_type">decimalType</a> | <a href="datatypes.html#double_type">doubleType</a> | <a href="datatypes.html#real_type">realType</a> | <a href="datatypes.html#date_type">dateType</a> | <a href="datatypes.html#time_type">timeType</a> | <a href="datatypes.html#timestamp_type">timestampType</a>
| <a href="datatypes.html#binary_type">binaryType</a> | <a href="datatypes.html#other_type">otherType</a> | <a href="datatypes.html#varchar_type">varcharType</a> | <a href="datatypes.html#varchar_ignorecase_type">varcharIgnorecaseType</a> | <a href="datatypes.html#char_type">charType</a>
| <a href="datatypes.html#blob_type">blobType</a> | <a href="datatypes.html#clob_type">clobType</a> | <a href="datatypes.html#uuid_type">uuidType</a> | <a href="datatypes.html#array_type">arrayType</a>
</pre>
syntax-end -->
<p>A data type definition.</p>
<p>Example:</p>
<p class="notranslate">INT</p>

<h3 id="date" class="notranslate" onclick="switchBnf(this)">Date</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">DATE &apos; 2000-01-01 &apos;</code></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
DATE &apos;yyyy-MM-dd&apos;
</pre>
syntax-end -->
<p>A date literal. The limitations are the same as for the Java data type <code>java.sql.Date</code>, but for compatibility with other databases the suggested minimum and maximum years are 0001 and 9999.</p>
<p>Example:</p>
<p class="notranslate">DATE &#39;2004-12-31&#39;</p>

<h3 id="decimal" class="notranslate" onclick="switchBnf(this)">Decimal</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">+</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">-</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#number">number</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">. <a href="grammar.html#number">number</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">. <a href="grammar.html#number">number</a></code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">E</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">+</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">-</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#number">expNumber</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">...</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
[ + | - ] { { <a href="grammar.html#number">number</a> [ . <a href="grammar.html#number">number</a> ] } | { . <a href="grammar.html#number">number</a> } } [ E [ + | - ] <a href="grammar.html#number">expNumber</a> [...] ] ]
</pre>
syntax-end -->
<p>A decimal number with fixed precision and scale. Internally, <code>java.lang.BigDecimal</code> is used. To ensure the floating point representation is used, use <code>CAST</code>(X <code>AS DOUBLE</code>). There are some special decimal values: to represent positive infinity, use <code>POWER(0, -1)</code>; for negative infinity, use <code>(-POWER(0, -1))</code>; for -0.0, use <code>(-CAST(0 AS DOUBLE))</code>; for <code>NaN</code> (not a number), use <code>SQRT(-1)</code>.</p>
<p>Example:</p>
<p class="notranslate">SELECT -1600.05<br />SELECT CAST(0 AS DOUBLE)<br />SELECT -1.4e-10</p>

<h3 id="digit" class="notranslate" onclick="switchBnf(this)">Digit</h3>
<!-- railroad-start -->
<code class="c">0-9</code>
<!-- railroad-end -->
<!-- syntax-start
<pre>
0-9
</pre>
syntax-end -->
<p>A digit.</p>
<p>Example:</p>
<p class="notranslate">0</p>

<h3 id="dollar_quoted_string" class="notranslate" onclick="switchBnf(this)">Dollar Quoted String</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">$ $ anything $ $</code></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
$$anything$$
</pre>
syntax-end -->
<p>A string starts and ends with two dollar signs. Two dollar signs are not allowed within the text. A whitespace is required before the first set of dollar signs. No escaping is required within the text.</p>
<p>Example:</p>
<p class="notranslate">&#36;&#36;John&#39;s car&#36;&#36;</p>

<h3 id="expression" class="notranslate" onclick="switchBnf(this)">Expression</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#and_condition">andCondition</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">OR <a href="grammar.html#and_condition">andCondition</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">...</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#and_condition">andCondition</a> [ { OR <a href="grammar.html#and_condition">andCondition</a> } [...] ]
</pre>
syntax-end -->
<p>Value or condition.</p>
<p>Example:</p>
<p class="notranslate">ID=1 OR NAME=&#39;Hi&#39;</p>

<h3 id="factor" class="notranslate" onclick="switchBnf(this)">Factor</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#term">term</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">*</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">/</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">%</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#term">term</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">...</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#term">term</a> [ { { * | / | % } <a href="grammar.html#term">term</a> } [...] ]
</pre>
syntax-end -->
<p>A value or a numeric factor.</p>
<p>Example:</p>
<p class="notranslate">ID * 10</p>

<h3 id="hex" class="notranslate" onclick="switchBnf(this)">Hex</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c"><a href="grammar.html#digit">digit</a></code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">a - f</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">A-F</code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c"><a href="grammar.html#digit">digit</a></code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">a - f</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">A-F</code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">...</code></td><td class="le"></td></tr></table></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
{ { <a href="grammar.html#digit">digit</a> | a-f | A-F } { <a href="grammar.html#digit">digit</a> | a-f | A-F } } [...]
</pre>
syntax-end -->
<p>The hexadecimal representation of a number or of bytes. Two characters are one byte.</p>
<p>Example:</p>
<p class="notranslate">cafe</p>

<h3 id="hex_number" class="notranslate" onclick="switchBnf(this)">Hex Number</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">+</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">-</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">0x <a href="grammar.html#hex">hex</a></code></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
[ + | - ] 0x <a href="grammar.html#hex">hex</a>
</pre>
syntax-end -->
<p>A number written in hexadecimal notation.</p>
<p>Example:</p>
<p class="notranslate">0xff</p>

<h3 id="index_column" class="notranslate" onclick="switchBnf(this)">Index Column</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#name">columnName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">ASC</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">DESC</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">NULLS</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">FIRST</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">LAST</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#name">columnName</a> [ ASC | DESC ] [ NULLS { FIRST | LAST } ]
</pre>
syntax-end -->
<p>Indexes this column in ascending or descending order. Usually it is not required to specify the order; however doing so will speed up large queries that order the column in the same way.</p>
<p>Example:</p>
<p class="notranslate">NAME</p>

<h3 id="int" class="notranslate" onclick="switchBnf(this)">Int</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">+</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">-</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#number">number</a></code></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
[ + | - ] <a href="grammar.html#number">number</a>
</pre>
syntax-end -->
<p>The maximum integer number is 2147483647, the minimum is -2147483648.</p>
<p>Example:</p>
<p class="notranslate">10</p>

<h3 id="long" class="notranslate" onclick="switchBnf(this)">Long</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">+</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">-</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#number">number</a></code></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
[ + | - ] <a href="grammar.html#number">number</a>
</pre>
syntax-end -->
<p>Long numbers are between -9223372036854775808 and 9223372036854775807.</p>
<p>Example:</p>
<p class="notranslate">100000</p>

<h3 id="name" class="notranslate" onclick="switchBnf(this)">Name</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">A-Z | _</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">A-Z | _</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">0-9</code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">...</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#quoted_name">quotedName</a></code></td><td class="le"></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
{ { A-Z|_  } [ { A-Z|_|0-9 } [...] ] } | <a href="grammar.html#quoted_name">quotedName</a>
</pre>
syntax-end -->
<p>Names are not case sensitive. There is no maximum name length.</p>
<p>Example:</p>
<p class="notranslate">TEST</p>

<h3 id="null" class="notranslate" onclick="switchBnf(this)">Null</h3>
<!-- railroad-start -->
<code class="c">NULL</code>
<!-- railroad-end -->
<!-- syntax-start
<pre>
NULL
</pre>
syntax-end -->
<p><code>NULL</code> is a value without data type and means &#39;unknown value&#39;.</p>
<p>Example:</p>
<p class="notranslate">NULL</p>

<h3 id="number" class="notranslate" onclick="switchBnf(this)">Number</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#digit">digit</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">...</code></td><td class="le"></td></tr></table></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#digit">digit</a> [...]
</pre>
syntax-end -->
<p>The maximum length of the number depends on the data type used.</p>
<p>Example:</p>
<p class="notranslate">100</p>

<h3 id="numeric" class="notranslate" onclick="switchBnf(this)">Numeric</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c"><a href="grammar.html#decimal">decimal</a></code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#int">int</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#long">long</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#hex_number">hexNumber</a></code></td><td class="le"></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#decimal">decimal</a> | <a href="grammar.html#int">int</a> | <a href="grammar.html#long">long</a> | <a href="grammar.html#hex_number">hexNumber</a>
</pre>
syntax-end -->
<p>The data type of a numeric value is always the lowest possible for the given value. If the number contains a dot this is decimal; otherwise it is int, long, or decimal (depending on the value).</p>
<p>Example:</p>
<p class="notranslate">SELECT -1600.05<br />SELECT CAST(0 AS DOUBLE)<br />SELECT -1.4e-10</p>

<h3 id="operand" class="notranslate" onclick="switchBnf(this)">Operand</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#summand">summand</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">|| <a href="grammar.html#summand">summand</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">...</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#summand">summand</a> [ { || <a href="grammar.html#summand">summand</a> } [...] ]
</pre>
syntax-end -->
<p>A value or a concatenation of values.</p>
<p>Example:</p>
<p class="notranslate">&#39;Hi&#39; || &#39; Eva&#39;</p>

<h3 id="order" class="notranslate" onclick="switchBnf(this)">Order</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c"><a href="grammar.html#int">int</a></code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#expression">expression</a></code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">ASC</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">DESC</code></td><td class="le"></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">NULLS</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">FIRST</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">LAST</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
{ <a href="grammar.html#int">int</a> | <a href="grammar.html#expression">expression</a> } [ ASC | DESC ] [ NULLS { FIRST | LAST } ]
</pre>
syntax-end -->
<p>Sorts the result by the given column number, or by an expression. If the expression is a single parameter, then the value is interpreted as a column number. Negative column numbers reverse the sort order.</p>
<p>Example:</p>
<p class="notranslate">NAME DESC NULLS LAST</p>

<h3 id="quoted_name" class="notranslate" onclick="switchBnf(this)">Quoted Name</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">&quot; anything &quot;</code></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
&quot;anything&quot;
</pre>
syntax-end -->
<p>Quoted names are case sensitive, and can contain spaces. There is no maximum name length. Two double quotes can be used to create a single double quote inside an identifier.</p>
<p>Example:</p>
<p class="notranslate">&quot;FirstName&quot;</p>

<h3 id="referential_constraint" class="notranslate" onclick="switchBnf(this)">Referential Constraint</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">FOREIGN KEY ( <a href="grammar.html#name">columnName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><code class="c">REFERENCES</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#name">refTableName</a></code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">( <a href="grammar.html#name">refColumnName</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">ON DELETE <a href="grammar.html#referential_action">referentialAction</a></code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">ON UPDATE <a href="grammar.html#referential_action">referentialAction</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
FOREIGN KEY ( <a href="grammar.html#name">columnName</a> [,...] )
REFERENCES [ <a href="grammar.html#name">refTableName</a> ] [ ( <a href="grammar.html#name">refColumnName</a> [,...] ) ]
[ ON DELETE <a href="grammar.html#referential_action">referentialAction</a> ] [ ON UPDATE <a href="grammar.html#referential_action">referentialAction</a> ]
</pre>
syntax-end -->
<p>Defines a referential constraint. If the table name is not specified, then the same table is referenced. <code>RESTRICT</code> is the default action. If the referenced columns are not specified, then the primary key columns are used. The required indexes are automatically created if required. Some tables may not be referenced, such as metadata tables.</p>
<p>Example:</p>
<p class="notranslate">FOREIGN KEY(ID) REFERENCES TEST(ID)</p>

<h3 id="referential_action" class="notranslate" onclick="switchBnf(this)">Referential Action</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">CASCADE</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">RESTRICT</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">NO ACTION</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">SET</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">DEFAULT</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">NULL</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
CASCADE | RESTRICT | NO ACTION | SET { DEFAULT | NULL }
</pre>
syntax-end -->
<p>The action <code>CASCADE</code> will cause conflicting rows in the referencing (child) table to be deleted or updated. <code>RESTRICT</code> is the default action. As this database does not support deferred checking, <code>RESTRICT</code> and <code>NO ACTION</code> will both throw an exception if the constraint is violated. The action <code>SET DEFAULT</code> will set the column in the referencing (child) table to the default value, while <code>SET NULL</code> will set it to <code>NULL</code>.</p>
<p>Example:</p>
<p class="notranslate">FOREIGN KEY(ID) REFERENCES TEST(ID) ON UPDATE CASCADE</p>

<h3 id="script_compression_encryption" class="notranslate" onclick="switchBnf(this)">Script Compression Encryption</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">COMPRESSION</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">DEFLATE</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">LZF</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">ZIP</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">GZIP</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">CIPHER <a href="grammar.html#cipher">cipher</a> PASSWORD <a href="grammar.html#string">string</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
[ COMPRESSION { DEFLATE | LZF | ZIP | GZIP } ] [ CIPHER <a href="grammar.html#cipher">cipher</a> PASSWORD <a href="grammar.html#string">string</a> ]
</pre>
syntax-end -->
<p>The compression and encryption algorithm to use for script files. When using encryption, only <code>DEFLATE</code> and <code>LZF</code> are supported. <code>LZF</code> is faster but uses more space.</p>
<p>Example:</p>
<p class="notranslate">COMPRESSION LZF</p>

<h3 id="select_expression" class="notranslate" onclick="switchBnf(this)">Select Expression</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">*</code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#expression">expression</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">AS</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#alias">columnAlias</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#alias">tableAlias</a> . *</code></td></tr></table></td><td class="le"></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
* | <a href="grammar.html#expression">expression</a> [ [ AS ] <a href="grammar.html#alias">columnAlias</a> ] | <a href="grammar.html#alias">tableAlias</a>.*
</pre>
syntax-end -->
<p>An expression in a <code>SELECT</code> statement.</p>
<p>Example:</p>
<p class="notranslate">ID AS VALUE</p>

<h3 id="string" class="notranslate" onclick="switchBnf(this)">String</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">&apos; anything &apos;</code></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
&apos;anything&apos;
</pre>
syntax-end -->
<p>A string starts and ends with a single quote. Two single quotes can be used to create a single quote inside a string.</p>
<p>Example:</p>
<p class="notranslate">&#39;John&#39;&#39;s car&#39;</p>

<h3 id="summand" class="notranslate" onclick="switchBnf(this)">Summand</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#factor">factor</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">+</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">-</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#factor">factor</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">...</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#factor">factor</a> [ { { + | - } <a href="grammar.html#factor">factor</a> } [...] ]
</pre>
syntax-end -->
<p>A value or a numeric sum.</p><p>Please note the text concatenation operator is <code>||</code>.</p>
<p>Example:</p>
<p class="notranslate">ID + 20</p>

<h3 id="table_expression" class="notranslate" onclick="switchBnf(this)">Table Expression</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#name">schemaName</a> .</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#name">tableName</a></code></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">( <a href="grammar.html#select">select</a> )</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#values_expression">valuesExpression</a></code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">AS</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#alias">newTableAlias</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table><br /><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">LEFT</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">RIGHT</code></td><td class="le"></td></tr></table></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">OUTER</code></td><td class="le"></td></tr></table></td></tr></table></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">INNER</code></td><td class="le"></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c">CROSS</code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">NATURAL</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">JOIN <a href="grammar.html#table_expression">tableExpression</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">ON <a href="grammar.html#expression">expression</a></code></td></tr></table></td><td class="le"></td></tr></table></td></tr></table></td><td class="le"></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
{ [ <a href="grammar.html#name">schemaName</a>. ] <a href="grammar.html#name">tableName</a> | ( <a href="grammar.html#select">select</a> ) | <a href="grammar.html#values_expression">valuesExpression</a> } [ [ AS ] <a href="grammar.html#alias">newTableAlias</a> ]
[ { { LEFT | RIGHT } [ OUTER ] | [ INNER ] | CROSS | NATURAL }
JOIN <a href="grammar.html#table_expression">tableExpression</a> [ ON <a href="grammar.html#expression">expression</a> ] ]
</pre>
syntax-end -->
<p>Joins a table. The join expression is not supported for cross and natural joins. A natural join is an inner join, where the condition is automatically on the columns with the same name.</p>
<p>Example:</p>
<p class="notranslate">TEST AS T LEFT JOIN TEST AS T1 ON T.ID = T1.ID</p>

<h3 id="values_expression" class="notranslate" onclick="switchBnf(this)">Values Expression</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">VALUES ( <a href="grammar.html#expression">expression</a></code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c">)</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">, ...</code></td><td class="le"></td></tr></table></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
VALUES { ( <a href="grammar.html#expression">expression</a> [,...] ) } [,...]
</pre>
syntax-end -->
<p>A list of rows that can be used like a table. The column list of the resulting table is C1, C2, and so on.</p>
<p>Example:</p>
<p class="notranslate">SELECT * FROM (VALUES(1, &#39;Hello&#39;), (2, &#39;World&#39;)) AS V;</p>

<h3 id="term" class="notranslate" onclick="switchBnf(this)">Term</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c"><a href="grammar.html#value">value</a></code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#name">columnName</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">?</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#int">int</a></code></td><td class="le"></td></tr></table></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">NEXT VALUE FOR <a href="grammar.html#name">sequenceName</a></code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="functions.html">Function</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c">-</code></td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c">+</code></td><td class="le"></td></tr></table></td><td class="d"><code class="c"><a href="grammar.html#term">term</a></code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">( <a href="grammar.html#expression">expression</a> )</code></td></tr></table></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#select">select</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#case">case</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#case_when">caseWhen</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c"><a href="grammar.html#alias">tableAlias</a> . <a href="grammar.html#name">columnName</a></code></td></tr></table></td><td class="le"></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#value">value</a>
| <a href="grammar.html#name">columnName</a>
| ?[ <a href="grammar.html#int">int</a> ]
| NEXT VALUE FOR <a href="grammar.html#name">sequenceName</a>
| function
| { - | + } <a href="grammar.html#term">term</a>
| ( <a href="grammar.html#expression">expression</a> )
| <a href="grammar.html#select">select</a>
| <a href="grammar.html#case">case</a>
| <a href="grammar.html#case_when">caseWhen</a>
| <a href="grammar.html#alias">tableAlias</a>.<a href="grammar.html#name">columnName</a>
</pre>
syntax-end -->
<p>A value. Parameters can be indexed, for example <code>?1</code> meaning the first parameter. Each table has a pseudo-column named <code>_ROWID_</code> that contains the unique row identifier.</p>
<p>Example:</p>
<p class="notranslate">&#39;Hello&#39;</p>

<h3 id="time" class="notranslate" onclick="switchBnf(this)">Time</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">TIME &apos; 12:00:00 &apos;</code></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
TIME &apos;hh:mm:ss&apos;
</pre>
syntax-end -->
<p>A time literal.</p>
<p>Example:</p>
<p class="notranslate">TIME &#39;23:59:59&#39;</p>

<h3 id="timestamp" class="notranslate" onclick="switchBnf(this)">Timestamp</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="d"><code class="c">TIMESTAMP &apos; 2000-01-01 12:00:00</code></td><td class="d"><table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d">&nbsp;</td><td class="te"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><table class="railroad"><tr class="railroad"><td class="d"><code class="c">. 000000000</code></td></tr></table></td><td class="le"></td></tr></table></td><td class="d"><code class="c">&apos;</code></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
TIMESTAMP &apos;yyyy-MM-dd hh:mm:ss[.nnnnnnnnn]&apos;
</pre>
syntax-end -->
<p>A timestamp literal. The limitations are the same as for the Java data type <code>java.sql.Timestamp</code>, but for compatibility with other databases the suggested minimum and maximum years are 0001 and 9999.</p>
<p>Example:</p>
<p class="notranslate">TIMESTAMP &#39;2005-12-31 23:59:59&#39;</p>

<h3 id="value" class="notranslate" onclick="switchBnf(this)">Value</h3>
<!-- railroad-start -->
<table class="railroad"><tr class="railroad"><td class="ts"></td><td class="d"><code class="c"><a href="grammar.html#string">string</a></code></td><td class="te"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#dollar_quoted_string">dollarQuotedString</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#numeric">numeric</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#date">date</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#time">time</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#timestamp">timestamp</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#boolean">boolean</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#bytes">bytes</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ks"></td><td class="d"><code class="c"><a href="grammar.html#array">array</a></code></td><td class="ke"></td></tr><tr class="railroad"><td class="ls"></td><td class="d"><code class="c"><a href="grammar.html#null">null</a></code></td><td class="le"></td></tr></table>
<!-- railroad-end -->
<!-- syntax-start
<pre>
<a href="grammar.html#string">string</a> | <a href="grammar.html#dollar_quoted_string">dollarQuotedString</a> | <a href="grammar.html#numeric">numeric</a> | <a href="grammar.html#date">date</a> | <a href="grammar.html#time">time</a> | <a href="grammar.html#timestamp">timestamp</a> | <a href="grammar.html#boolean">boolean</a> | <a href="grammar.html#bytes">bytes</a> | <a href="grammar.html#array">array</a> | <a href="grammar.html#null">null</a>
</pre>
syntax-end -->
<p>A literal value of any data type, or null.</p>
<p>Example:</p>
<p class="notranslate">10</p>

<h3 id="information_schema" class="notranslate">Information Schema</h3>
<p>
The system tables in the schema <code>INFORMATION_SCHEMA</code> contain the meta data
of all tables in the database as well as the current settings.
</p>
<table class="main">
<tr><th>Table</th><th>Columns</th></tr>

<tr class="notranslate">
    <td>CATALOGS</td>
    <td>CATALOG_NAME</td>
</tr>

<tr class="notranslate">
    <td>COLLATIONS</td>
    <td>NAME, KEY</td>
</tr>

<tr class="notranslate">
    <td>COLUMNS</td>
    <td>TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, ORDINAL_POSITION, COLUMN_DEFAULT, IS_NULLABLE, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH, CHARACTER_OCTET_LENGTH, NUMERIC_PRECISION, NUMERIC_PRECISION_RADIX, NUMERIC_SCALE, CHARACTER_SET_NAME, COLLATION_NAME, TYPE_NAME, NULLABLE, IS_COMPUTED, SELECTIVITY, CHECK_CONSTRAINT, SEQUENCE_NAME, REMARKS, SOURCE_DATA_TYPE</td>
</tr>

<tr class="notranslate">
    <td>COLUMN_PRIVILEGES</td>
    <td>GRANTOR, GRANTEE, TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, COLUMN_NAME, PRIVILEGE_TYPE, IS_GRANTABLE</td>
</tr>

<tr class="notranslate">
    <td>CONSTANTS</td>
    <td>CONSTANT_CATALOG, CONSTANT_SCHEMA, CONSTANT_NAME, DATA_TYPE, REMARKS, SQL, ID</td>
</tr>

<tr class="notranslate">
    <td>CONSTRAINTS</td>
    <td>CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, CONSTRAINT_NAME, CONSTRAINT_TYPE, TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, UNIQUE_INDEX_NAME, CHECK_EXPRESSION, COLUMN_LIST, REMARKS, SQL, ID</td>
</tr>

<tr class="notranslate">
    <td>CROSS_REFERENCES</td>
    <td>PKTABLE_CATALOG, PKTABLE_SCHEMA, PKTABLE_NAME, PKCOLUMN_NAME, FKTABLE_CATALOG, FKTABLE_SCHEMA, FKTABLE_NAME, FKCOLUMN_NAME, ORDINAL_POSITION, UPDATE_RULE, DELETE_RULE, FK_NAME, PK_NAME, DEFERRABILITY</td>
</tr>

<tr class="notranslate">
    <td>DOMAINS</td>
    <td>DOMAIN_CATALOG, DOMAIN_SCHEMA, DOMAIN_NAME, COLUMN_DEFAULT, IS_NULLABLE, DATA_TYPE, PRECISION, SCALE, TYPE_NAME, SELECTIVITY, CHECK_CONSTRAINT, REMARKS, SQL, ID</td>
</tr>

<tr class="notranslate">
    <td>FUNCTION_ALIASES</td>
    <td>ALIAS_CATALOG, ALIAS_SCHEMA, ALIAS_NAME, JAVA_CLASS, JAVA_METHOD, DATA_TYPE, TYPE_NAME, COLUMN_COUNT, RETURNS_RESULT, REMARKS, ID, SOURCE</td>
</tr>

<tr class="notranslate">
    <td>FUNCTION_COLUMNS</td>
    <td>ALIAS_CATALOG, ALIAS_SCHEMA, ALIAS_NAME, JAVA_CLASS, JAVA_METHOD, COLUMN_COUNT, POS, COLUMN_NAME, DATA_TYPE, TYPE_NAME, PRECISION, SCALE, RADIX, NULLABLE, COLUMN_TYPE, REMARKS, COLUMN_DEFAULT</td>
</tr>

<tr class="notranslate">
    <td>HELP</td>
    <td>ID, SECTION, TOPIC, SYNTAX, TEXT</td>
</tr>

<tr class="notranslate">
    <td>INDEXES</td>
    <td>TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, NON_UNIQUE, INDEX_NAME, ORDINAL_POSITION, COLUMN_NAME, CARDINALITY, PRIMARY_KEY, INDEX_TYPE_NAME, IS_GENERATED, INDEX_TYPE, ASC_OR_DESC, PAGES, FILTER_CONDITION, REMARKS, SQL, ID, SORT_TYPE, CONSTRAINT_NAME, INDEX_CLASS</td>
</tr>

<tr class="notranslate">
    <td>IN_DOUBT</td>
    <td>TRANSACTION, STATE</td>
</tr>

<tr class="notranslate">
    <td>LOCKS</td>
    <td>TABLE_SCHEMA, TABLE_NAME, SESSION_ID, LOCK_TYPE</td>
</tr>

<tr class="notranslate">
    <td>RIGHTS</td>
    <td>GRANTEE, GRANTEETYPE, GRANTEDROLE, RIGHTS, TABLE_SCHEMA, TABLE_NAME, ID</td>
</tr>

<tr class="notranslate">
    <td>ROLES</td>
    <td>NAME, REMARKS, ID</td>
</tr>

<tr class="notranslate">
    <td>SCHEMATA</td>
    <td>CATALOG_NAME, SCHEMA_NAME, SCHEMA_OWNER, DEFAULT_CHARACTER_SET_NAME, DEFAULT_COLLATION_NAME, IS_DEFAULT, REMARKS, ID</td>
</tr>

<tr class="notranslate">
    <td>SEQUENCES</td>
    <td>SEQUENCE_CATALOG, SEQUENCE_SCHEMA, SEQUENCE_NAME, CURRENT_VALUE, INCREMENT, IS_GENERATED, REMARKS, CACHE, ID</td>
</tr>

<tr class="notranslate">
    <td>SESSIONS</td>
    <td>ID, USER_NAME, SESSION_START, STATEMENT, STATEMENT_START</td>
</tr>

<tr class="notranslate">
    <td>SESSION_STATE</td>
    <td>KEY, SQL</td>
</tr>

<tr class="notranslate">
    <td>SETTINGS</td>
    <td>NAME, VALUE</td>
</tr>

<tr class="notranslate">
    <td>TABLES</td>
    <td>TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, TABLE_TYPE, STORAGE_TYPE, SQL, REMARKS, LAST_MODIFICATION, ID, TYPE_NAME, TABLE_CLASS</td>
</tr>

<tr class="notranslate">
    <td>TABLE_PRIVILEGES</td>
    <td>GRANTOR, GRANTEE, TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, PRIVILEGE_TYPE, IS_GRANTABLE</td>
</tr>

<tr class="notranslate">
    <td>TABLE_TYPES</td>
    <td>TYPE</td>
</tr>

<tr class="notranslate">
    <td>TRIGGERS</td>
    <td>TRIGGER_CATALOG, TRIGGER_SCHEMA, TRIGGER_NAME, TRIGGER_TYPE, TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, BEFORE, JAVA_CLASS, QUEUE_SIZE, NO_WAIT, REMARKS, SQL, ID</td>
</tr>

<tr class="notranslate">
    <td>TYPE_INFO</td>
    <td>TYPE_NAME, DATA_TYPE, PRECISION, PREFIX, SUFFIX, PARAMS, AUTO_INCREMENT, MINIMUM_SCALE, MAXIMUM_SCALE, RADIX, POS, CASE_SENSITIVE, NULLABLE, SEARCHABLE</td>
</tr>

<tr class="notranslate">
    <td>USERS</td>
    <td>NAME, ADMIN, REMARKS, ID</td>
</tr>

<tr class="notranslate">
    <td>VIEWS</td>
    <td>TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME, VIEW_DEFINITION, CHECK_OPTION, IS_UPDATABLE, STATUS, REMARKS, ID</td>
</tr>
</table>

<h3 id="range_table" class="notranslate">Range Table</h3>
<p>
The range table is a dynamic system table that contains all values from a start to an end value.
The table contains one column called X. Both the start and end values are included in the result.
The table is used as follows:
</p>
<p>Example:</p>
<pre>
SELECT X FROM SYSTEM_RANGE(1, 10);
</pre>

<!--[if lte IE 7]><script language="javascript">switchBnf(null);</script><![endif]-->

<!-- [close] { -->
</div></td></tr></table>
<script type="text/javascript" src="index.js"></script>
<script type="text/javascript" src="search.js"></script>
<script type="text/javascript">
function startTranslate() {
    document.getElementById('translate').style.display='';
    var script=document.createElement('script');
    script.setAttribute("type","text/javascript");
    script.setAttribute("src", "http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit");
    document.getElementsByTagName("head")[0].appendChild(script);
}
function googleTranslateElementInit() {
    new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');
}
</script>

<!-- } --><!-- analytics --></body></html>
